ocLazyLoad angular 按需加载
生活随笔
收集整理的這篇文章主要介紹了
ocLazyLoad angular 按需加载
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ionic 框架
1.引用
index.html 加載?<script type="text/javascript" src="lib/oclazyload/ocLazyLoad.min.js"></script>
2.注入
angular.module('starter', ['ionic', 'oc.lazyLoad'])
3.配置
.state('app.myinfo', {url: '/user/myinfo',views: {'menuContent': {templateUrl: 'templates/user/myinfo.html',controller: 'myinfoCtrl'}}, resolve: { // Any property in resolve should return a promise and is executed before the view is loadedloadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {// you can lazy load files for an existing modulereturn $ocLazyLoad.load(['js/controllersuser.js', 'js/directive.js']);}]}})?
轉載于:https://www.cnblogs.com/ignacio/p/5815543.html
總結
以上是生活随笔為你收集整理的ocLazyLoad angular 按需加载的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [转]序列化悍将Protobuf-Net
- 下一篇: 梦到有了个儿子有什么预兆