@@ -40,7 +40,7 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
40
40
deps="angular-route.js;angular-animate.js"
41
41
animations="true" fixBase="true">
42
42
<file name="index.html">
43
- <div ng-controller="MainCntl as main">
43
+ <div ng-controller="MainCtrl as main">
44
44
Choose:
45
45
<a href="Book/Moby">Moby</a> |
46
46
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
@@ -123,32 +123,32 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
123
123
function($routeProvider, $locationProvider) {
124
124
$routeProvider.when('/Book/:bookId', {
125
125
templateUrl: 'book.html',
126
- controller: BookCntl ,
126
+ controller: BookCtrl ,
127
127
controllerAs: 'book'
128
128
});
129
129
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
130
130
templateUrl: 'chapter.html',
131
- controller: ChapterCntl ,
131
+ controller: ChapterCtrl ,
132
132
controllerAs: 'chapter'
133
133
});
134
134
135
135
// configure html5 to get links working on jsfiddle
136
136
$locationProvider.html5Mode(true);
137
137
});
138
138
139
- function MainCntl ($route, $routeParams, $location) {
139
+ function MainCtrl ($route, $routeParams, $location) {
140
140
this.$route = $route;
141
141
this.$location = $location;
142
142
this.$routeParams = $routeParams;
143
143
}
144
144
145
- function BookCntl ($routeParams) {
146
- this.name = "BookCntl ";
145
+ function BookCtrl ($routeParams) {
146
+ this.name = "BookCtrl ";
147
147
this.params = $routeParams;
148
148
}
149
149
150
- function ChapterCntl ($routeParams) {
151
- this.name = "ChapterCntl ";
150
+ function ChapterCtrl ($routeParams) {
151
+ this.name = "ChapterCtrl ";
152
152
this.params = $routeParams;
153
153
}
154
154
</file>
@@ -157,14 +157,14 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
157
157
it('should load and compile correct template', function() {
158
158
element(by.linkText('Moby: Ch1')).click();
159
159
var content = element(by.css('[ng-view]')).getText();
160
- expect(content).toMatch(/controller\: ChapterCntl /);
160
+ expect(content).toMatch(/controller\: ChapterCtrl /);
161
161
expect(content).toMatch(/Book Id\: Moby/);
162
162
expect(content).toMatch(/Chapter Id\: 1/);
163
163
164
164
element(by.partialLinkText('Scarlet')).click();
165
165
166
166
content = element(by.css('[ng-view]')).getText();
167
- expect(content).toMatch(/controller\: BookCntl /);
167
+ expect(content).toMatch(/controller\: BookCtrl /);
168
168
expect(content).toMatch(/Book Id\: Scarlet/);
169
169
});
170
170
</file>
0 commit comments