From d5f208488376a4a2821dce0a24a4923aca8ff9d0 Mon Sep 17 00:00:00 2001 From: Gronblom Sam Date: Wed, 15 Jan 2014 19:02:30 +0900 Subject: 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 --- src/ngRoute/directive/ngView.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ngRoute/directive/ngView.js b/src/ngRoute/directive/ngView.js index 448e375c..a25563ae 100644 --- a/src/ngRoute/directive/ngView.js +++ b/src/ngRoute/directive/ngView.js @@ -40,7 +40,7 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory); deps="angular-route.js;angular-animate.js" animations="true" fixBase="true"> -
+
Choose: Moby | Moby: Ch1 | @@ -123,12 +123,12 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory); function($routeProvider, $locationProvider) { $routeProvider.when('/Book/:bookId', { templateUrl: 'book.html', - controller: BookCntl, + controller: BookCtrl, controllerAs: 'book' }); $routeProvider.when('/Book/:bookId/ch/:chapterId', { templateUrl: 'chapter.html', - controller: ChapterCntl, + controller: ChapterCtrl, controllerAs: 'chapter' }); @@ -136,19 +136,19 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory); $locationProvider.html5Mode(true); }); - function MainCntl($route, $routeParams, $location) { + function MainCtrl($route, $routeParams, $location) { this.$route = $route; this.$location = $location; this.$routeParams = $routeParams; } - function BookCntl($routeParams) { - this.name = "BookCntl"; + function BookCtrl($routeParams) { + this.name = "BookCtrl"; this.params = $routeParams; } - function ChapterCntl($routeParams) { - this.name = "ChapterCntl"; + function ChapterCtrl($routeParams) { + this.name = "ChapterCtrl"; this.params = $routeParams; } @@ -157,14 +157,14 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory); it('should load and compile correct template', function() { element(by.linkText('Moby: Ch1')).click(); var content = element(by.css('[ng-view]')).getText(); - expect(content).toMatch(/controller\: ChapterCntl/); + expect(content).toMatch(/controller\: ChapterCtrl/); expect(content).toMatch(/Book Id\: Moby/); expect(content).toMatch(/Chapter Id\: 1/); element(by.partialLinkText('Scarlet')).click(); content = element(by.css('[ng-view]')).getText(); - expect(content).toMatch(/controller\: BookCntl/); + expect(content).toMatch(/controller\: BookCtrl/); expect(content).toMatch(/Book Id\: Scarlet/); }); -- cgit v1.2.3