我想在我的app角度中使用“angular-ui-load”。 问题,我的脚本js是未定义的 dev consol firefox出错:
"Error: [ng:areq] Argument 'DetailsCtrl' is not a function, got undefined
现在,index.html中声明的angular-ui-load
<!-- build:js scripts/modules.js -->
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/services/ui-load.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/alert.js"></script>
<script src="scripts/controllers/users.js"></script>
<script src="scripts/directives/ui-jq.js"></script>
<!-- endbuild -->
和'ui.load'我的app.js是:
'use strict';
angular.module('webApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ui.router',
'ui.load',
'ui.jq',
'zumba.angular-waypoints'
])
.run(
[ '$rootScope', '$state', '$stateParams',
function ($rootScope, $state, $stateParams) {
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
}
]
)
.config(function ($stateProvider, $urlRouterProvider) {
//delete $httpProvider.defaults.headers.common['X-Requested-With'];
$urlRouterProvider.otherwise('/');
$stateProvider
.state('users', {
url: '/users',
templateUrl: 'views/users.html',
controller:'UserCtrl'
})
.state('users.details', {
url: '/details/:id_user',
templateUrl: 'views/details.html',
//controller:'UserCtrl'
resolve: {
deps: ['uiLoad',
function( uiLoad){
return uiLoad.load('scripts/controllers/details.js');
}]
}
})
})
任何帮助将不胜感激:-)?