Angular - 加载所有JS时的调用函数

时间:2015-08-15 17:29:11

标签: javascript angularjs oclazyload

我想在加载所有文件(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版本

0 个答案:

没有答案