aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGronblom Sam2014-01-15 19:02:30 +0900
committerPawel Kozlowski2014-03-02 22:37:29 +0100
commitd5f208488376a4a2821dce0a24a4923aca8ff9d0 (patch)
tree1a5bc16d24d1c0db0d50f933f470434a46c9141d
parent9bffccd935db50c005befdc800275cf6a4c37ec1 (diff)
downloadangular.js-d5f208488376a4a2821dce0a24a4923aca8ff9d0.tar.bz2
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
-rw-r--r--src/ngRoute/directive/ngView.js20
1 files 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">
<file name="index.html">
- <div ng-controller="MainCntl as main">
+ <div ng-controller="MainCtrl as main">
Choose:
<a href="Book/Moby">Moby</a> |
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
@@ -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;
}
</file>
@@ -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/);
});
</file>