@@ -25,7 +25,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
25
25
26
26
. segment ( 's1' , {
27
27
templateUrl : 'templates/section1.html' ,
28
- controller : MainCtrl } )
28
+ controller : ' MainCtrl' } )
29
29
30
30
. within ( )
31
31
@@ -35,7 +35,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
35
35
36
36
. segment ( 'itemInfo' , {
37
37
templateUrl : 'templates/section1/item.html' ,
38
- controller : Section1ItemCtrl ,
38
+ controller : ' Section1ItemCtrl' ,
39
39
dependencies : [ 'id' ] } )
40
40
41
41
. within ( )
@@ -56,7 +56,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
56
56
57
57
. segment ( 's2' , {
58
58
templateUrl : 'templates/section2.html' ,
59
- controller : MainCtrl } )
59
+ controller : ' MainCtrl' } )
60
60
61
61
. within ( )
62
62
@@ -177,43 +177,43 @@ app.config(function($routeSegmentProvider, $routeProvider) {
177
177
178
178
app . value ( 'loader' , { show : false } ) ;
179
179
180
- function MainCtrl ( $scope , $routeSegment , loader ) {
180
+ app . controller ( ' MainCtrl' , function ( $scope , $routeSegment , loader ) {
181
181
182
182
$scope . $routeSegment = $routeSegment ;
183
183
$scope . loader = loader ;
184
184
185
185
$scope . $on ( 'routeSegmentChange' , function ( ) {
186
186
loader . show = false ;
187
187
} )
188
- }
188
+ } ) ;
189
189
190
- function Section1Ctrl ( $scope , $routeSegment ) {
190
+ app . controller ( ' Section1Ctrl' , function ( $scope , $routeSegment ) {
191
191
192
192
$scope . $routeSegment = $routeSegment ;
193
193
$scope . test = { btnClicked : false } ;
194
194
$scope . items = [ 1 , 2 , 3 , 4 , 5 ] ;
195
- }
195
+ } ) ;
196
196
197
- function Section1ItemCtrl ( $scope , $routeSegment ) {
197
+ app . controller ( ' Section1ItemCtrl' , function ( $scope , $routeSegment ) {
198
198
199
199
$scope . $routeSegment = $routeSegment ;
200
200
$scope . item = { id : $routeSegment . $routeParams . id } ;
201
201
$scope . test = { textValue : '' } ;
202
- }
202
+ } ) ;
203
203
204
- function Section2Ctrl ( $scope , $routeSegment ) {
204
+ app . controller ( ' Section2Ctrl' , function ( $scope , $routeSegment ) {
205
205
206
206
$scope . $routeSegment = $routeSegment ;
207
207
$scope . test = { textValue : '' } ;
208
208
$scope . items = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ;
209
- }
209
+ } ) ;
210
210
211
- function ErrorCtrl ( $scope , error ) {
211
+ app . controller ( ' ErrorCtrl' , function ( $scope , error ) {
212
212
$scope . error = error ;
213
- }
213
+ } ) ;
214
214
215
- function SlowDataCtrl ( $scope , data , loader ) {
215
+ app . controller ( ' SlowDataCtrl' , function ( $scope , data , loader ) {
216
216
loader . show = false ;
217
217
$scope . data = data ;
218
- }
218
+ } ) ;
219
219
0 commit comments