[AngularJS] Lazy Loading modules with ui-router and ocLazyLoad
We've looked at lazy loading with ocLazyLoad previously, but what if we are using ui-router and want to lazy load modules when we change states?
angular.module("demo", ["ui.router", "oc.lazyLoad"])
.config(function ($stateProvider) {
$stateProvider.state('store', {
templateUrl: "store/store.html",
controller: "StoreCtrl as store",
resolve: {
store: function ($ocLazyLoad) {
return $ocLazyLoad.load(
{
name: "store",
files: ["store/store.js"]
}
)
}
}
})
}) .controller("AppCtrl", function ($state) {
var app = this;
app.click = function () {
$state.go("store")
}
})
[AngularJS] Lazy Loading modules with ui-router and ocLazyLoad的更多相关文章
- [AngularJS] Lazy loading Angular modules with ocLazyLoad
With the ocLazyLoad you can load AngularJS modules on demand. This is very handy for runtime loading ...
- [Angular Router] Lazy loading Module with Auxiliary router
Found the way to handle Auxiliary router for lazy loading moudle and erge load module are different. ...
- [Angular2 Router] Lazy Load Angular 2 Modules with the Router
Angular 2 lazy loading is a core feature of Angular 2. Lazy loading allows your application to start ...
- AngularJS 使用 UI Router 实现表单向导
Today we will be using AngularJS and the great UI Router and the Angular ngAnimate module to create ...
- angularjs ngRoute和ui.router对比
ngRoute模块是angularjs自带的路由模块,ui.router是一个第三方路由模块,接下来将对两者进行一个对比: ng-router(angular-router.js) ng-view n ...
- [转]AngularJS 使用 UI Router 实现表单向导
本文转自:http://www.oschina.net/translate/angularjs-multi-step-form-using-ui-router 今天我们将使用AngularJs和伟大的 ...
- [转]AngularJS+UI Router(1) 多步表单
本文转自:https://www.zybuluo.com/dreamapplehappy/note/54448 多步表单的实现 在线demo演示地址https://rawgit.com/dream ...
- angularJS ui router 多视图单独刷新问题
场景:视图层级如下 view1 --view11 --view111 需求:view11的一个动作过后,单独刷新view12 解决方式:修改层级设计 view1 --view11 --view111 ...
- ngRoute 和 ui.router 的使用方法和区别
在单页面应用中要把各个分散的视图给组织起来是通过路由机制来实现的.本文主要对 AngularJS 原生的 ngRoute 路由模块和第三方路由模块 ui.router 的用法进行简单介绍,并做一个对比 ...
随机推荐
- SQL点滴之编辑数据(转)
数据库中的数据编辑是我们遇到的最频繁的工作,这一个随笔中我来总结一下最常用的数据编辑. select into 经常遇到一种情况是,我们希望创建一个新表,表中的数据来源于原有的一个表:原有一个表,但是 ...
- CABasicAnimation(CAKeyframeAnimation)keypath 取值
- keyPath可以使用的key - #define angle2Radian(angle) ((angle)/180.0*M_PI) - transform.rotation.x 围绕x轴翻转 参 ...
- VC++6.0 MFC播放视频
注:需要在windows xp下才可以使用Windows Media Player插件,在windows 7下面会找不到该插件. 1.Windows Media Player控件的主要方法: 1)Ge ...
- SQL遍历字符串的方法
字符串穿越: 1.创建一个只存递增序列(1…n)的表——Temp,并将它与目标字符串所在的表Src进行笛卡尔运算.(Temp表的记录数要不小于遍历的目标字符串的长度) 2.过滤掉序列值大于串长的行. ...
- 关于display显示 linux
export DISPLAY=ipaddressofyourmachineorpc:0.0 如果要在本来的机器上显示,使用 export DISPLAY=localhost:0
- Intellij IDEA,WebStorm-keymap(转)
1. ctrl + shift + n: 打开工程中的文件2. ctrl + j: 输出模板3. ctrl + b: 跳到变量申明处4. ctrl + alt + T: 围绕包裹代码(包括zencod ...
- git 记录
在官网有详细的教程http://git-scm.com/book/zh/%E8%B5%B7%E6%AD%A5 查看分支和日志的两个工具:gitk 和 tig ,两个都有 --all 参数,可以查看所有 ...
- The Datastore
[中央数据库模式难扩展]绝大多数的Web应用在处理一个为了以后的请求作检索用的请求时,需要存储信息.<1.Most useful web applications need to store i ...
- redis.conf的配置
daemonize yes : redis server 实例是否以后台方式运行 , no:不以后台方式运行(默认) , yes:以后台方式运行. requirepass 密码 : 密码最好长 ...
- 安卓升级提示 phoneGap APK软件更新提示
以下代码由PHP200 阿杜整理 package com.example.syzx; import java.io.BufferedReader; import java.io.File; imp ...