$stateProvider
.state('index', {
url: '/',
views: {
'lazyLoadView': {
templateUrl: 'partials/main.html',
controller: 'AppCtrl'
}
},
resolve: {
loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad){
return $ocLazyLoad.load('js/AppCtrl.js')
}]
}
})
angular.module('myApp')
.controller('AppCtrl', ['$scope', function($scope){
//...
}])
angular.module('gridModule', [[
'bower_components/angular-ui-grid/ui-grid.js',
'bower_components/angular-ui-grid/ui-grid.css'
]]).controller('GridModuleCtrl', ['$scope', function($scope){
//...
}])
angular.module('myApp')
.controller('AppCtrl', ['$scope','$ocLazyLoad', function($scope, $ocLazyLoad){
$scope.loadBootstrap = function(){
$ocLazyLoad.load([
'bower_components/bootstrap/dist/js/bootstrap.js',
'bower_components/bootstrap/dist/css/bootstrap.css'
])
}
var unbind = $scope.$on('ocLazyLoad.fileLoaded', function(e, file){
$scope.bootstrapLoaded = true;
console.log('下载boot完成');
unbind();
})
}])
/*template A.html*/
<h1>hi i am hzp </h1>
<div oc-lazy-load="gridModule">
<div ng-controller="GridModuleCtrl">
<span>{{test}}</span><br/>
<div ui-grid="gridOptions" class="gridStyle"></div>
</div>
</div>
</div>
$ocLazyLoadProvider.config({
modules: [{
name: 'gridModule',
files: [
'js/gridModule.js'
]
}]
})
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有