Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d5f2084

Browse files
sgronblopkozlowski-opensource
authored andcommitted
docs(ngView): rename controller suffix in ngView example
- According to https://github.com/angular/angular.js/blob/5bf81bc111a866ec65ef86c01336911e577df5df/docs/content/guide/controller.ngdoc#L166 Ctrl should be the suffix for a controller Closes #5817
1 parent 9bffccd commit d5f2084

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/ngRoute/directive/ngView.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
4040
deps="angular-route.js;angular-animate.js"
4141
animations="true" fixBase="true">
4242
<file name="index.html">
43-
<div ng-controller="MainCntl as main">
43+
<div ng-controller="MainCtrl as main">
4444
Choose:
4545
<a href="Book/Moby">Moby</a> |
4646
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
@@ -123,32 +123,32 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
123123
function($routeProvider, $locationProvider) {
124124
$routeProvider.when('/Book/:bookId', {
125125
templateUrl: 'book.html',
126-
controller: BookCntl,
126+
controller: BookCtrl,
127127
controllerAs: 'book'
128128
});
129129
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
130130
templateUrl: 'chapter.html',
131-
controller: ChapterCntl,
131+
controller: ChapterCtrl,
132132
controllerAs: 'chapter'
133133
});
134134
135135
// configure html5 to get links working on jsfiddle
136136
$locationProvider.html5Mode(true);
137137
});
138138
139-
function MainCntl($route, $routeParams, $location) {
139+
function MainCtrl($route, $routeParams, $location) {
140140
this.$route = $route;
141141
this.$location = $location;
142142
this.$routeParams = $routeParams;
143143
}
144144
145-
function BookCntl($routeParams) {
146-
this.name = "BookCntl";
145+
function BookCtrl($routeParams) {
146+
this.name = "BookCtrl";
147147
this.params = $routeParams;
148148
}
149149
150-
function ChapterCntl($routeParams) {
151-
this.name = "ChapterCntl";
150+
function ChapterCtrl($routeParams) {
151+
this.name = "ChapterCtrl";
152152
this.params = $routeParams;
153153
}
154154
</file>
@@ -157,14 +157,14 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
157157
it('should load and compile correct template', function() {
158158
element(by.linkText('Moby: Ch1')).click();
159159
var content = element(by.css('[ng-view]')).getText();
160-
expect(content).toMatch(/controller\: ChapterCntl/);
160+
expect(content).toMatch(/controller\: ChapterCtrl/);
161161
expect(content).toMatch(/Book Id\: Moby/);
162162
expect(content).toMatch(/Chapter Id\: 1/);
163163
164164
element(by.partialLinkText('Scarlet')).click();
165165
166166
content = element(by.css('[ng-view]')).getText();
167-
expect(content).toMatch(/controller\: BookCntl/);
167+
expect(content).toMatch(/controller\: BookCtrl/);
168168
expect(content).toMatch(/Book Id\: Scarlet/);
169169
});
170170
</file>

0 commit comments

Comments
 (0)