1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
'use strict';
angular.module('webApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ui.router',
'ui.load', //<- ici!!!
'ui.jq',
'zumba.angular-waypoints'
])
.run(
[ '$rootScope', '$state', '$stateParams',
function ($rootScope, $state, $stateParams) {
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
}
]
)
.config(function ($stateProvider, $urlRouterProvider, JQ_CONFIG) {
//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', //<- et là!!!
function( uiLoad){
return uiLoad.load('scripts/controllers/details.js');
}]
}
})
}) |
Partager