我想在加载所有文件(JS)时调用一个函数(因为我想调用这些文件之一中的函数)。我怎么做?
.state('dashboard', {
url: "/dashboard.html",
templateUrl: "views/dashboard.html",
data: {pageTitle: 'Dashboard'},
controller: "DashboardController",
resolve: {
deps: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'MetronicApp',
insertBefore: '#ng_load_plugins_before',
files: [
'/assets/global/plugins/morris/morris.css',
'/assets/admin/pages/css/tasks.css',
'/assets/global/plugins/morris/morris.min.js',
'/assets/global/plugins/morris/raphael-min.js',
'/assets/global/plugins/jquery.sparkline.min.js',
'/assets/admin/pages/scripts/index3.js',
'/assets/admin/pages/scripts/tasks.js',
//'/js_custom/dashboard.js',
'js/controllers/DashboardController.js'
]
});
}]
}
})
来源:Metronic Template AngularJS 版本