@@ -22,7 +22,7 @@ Support following amd/cmd loaders:
2222* ` Sea.js `
2323* ` System.js `
2424
25- Support ` controllerUrl ` config in ` angular-ui-router ` and ` angular-route ` :
25+ Support ` controllerUrl/denpendencies ` config in ` angular-ui-router ` and ` angular-route ` :
2626
2727* ` $stateProvider.state `
2828* ` $routeProvider.when `
@@ -100,27 +100,18 @@ define(function (require) {
100100 .state (' home' , {
101101 url: ' /home' ,
102102 templateUrl: ' home/home.html' ,
103- // new attribute for ajax load controller js
103+ // new attribute for ajax load controller
104104 controllerUrl: ' home/homeCtrl' ,
105105 controller: ' homeCtrl'
106106 })
107107 .state (' users' , app .route ({
108108 url: ' /users' ,
109109 templateUrl: ' users/users.html' ,
110- // new attribute for ajax load controller js
110+ // new attribute for ajax load controller
111111 controllerUrl: ' users/usersCtrl' ,
112112 controller: ' usersCtrl' ,
113-
114- /*
115- // customize to load more dependencies
116- resolve: {
117- dummy: app.load([
118- 'users/usersCtrl', // controller
119- 'services/usersService' // service
120- // filters, directives, ...
121- ])
122- }
123- */
113+ // load more controllers, services, filters, ...
114+ dependencies: [' services/usersService' ]
124115 }));
125116 }]);
126117});
@@ -132,8 +123,8 @@ define(function (require) {
132123define (function (require ) {
133124 var app = require (' ../app' );
134125
135- // dynamic load services js
136- require (' ../services/usersService' );
126+ // dynamic load services here or add into dependencies of state config
127+ // require('../services/usersService');
137128
138129 app .controller (' usersCtrl' , [' $scope' , function ($scope ) {
139130 // shortcut to get angular injected service.
0 commit comments