diff --git a/src/ng/directive/ngView.js b/src/ng/directive/ngView.js index 8d7c87c57170..d5ef2c71ad48 100644 --- a/src/ng/directive/ngView.js +++ b/src/ng/directive/ngView.js @@ -105,12 +105,12 @@ $routeProvider.when('/Book/:bookId', { templateUrl: 'book.html', controller: BookCntl, - controllerAlias: 'book' + controllerAs: 'book' }); $routeProvider.when('/Book/:bookId/ch/:chapterId', { templateUrl: 'chapter.html', controller: ChapterCntl, - controllerAlias: 'chapter' + controllerAs: 'chapter' }); // configure html5 to get links working on jsfiddle @@ -204,8 +204,8 @@ var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$c if (current.controller) { locals.$scope = lastScope; controller = $controller(current.controller, locals); - if (current.controllerAlias) { - lastScope[current.controllerAlias] = controller; + if (current.controllerAs) { + lastScope[current.controllerAs] = controller; } element.children().data('$ngControllerController', controller); } diff --git a/src/ng/route.js b/src/ng/route.js index 4014dfa80701..12e560c76535 100644 --- a/src/ng/route.js +++ b/src/ng/route.js @@ -44,8 +44,8 @@ function $RouteProvider(){ * - `controller` – `{(string|function()=}` – Controller fn that should be associated with newly * created scope or the name of a {@link angular.Module#controller registered controller} * if passed as a string. - * - `controllerAlias` – `{string=}` – A controller alias name. If present the controller will be - * published to scope under the `controllerAlias` name. + * - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be + * published to scope under the `controllerAs` name. * - `template` – `{string=|function()=}` – html template as a string or function that returns * an html template as a string which should be used by {@link ng.directive:ngView ngView} or * {@link ng.directive:ngInclude ngInclude} directives. diff --git a/test/ng/directive/ngViewSpec.js b/test/ng/directive/ngViewSpec.js index 3150c0405c28..93b850024c3b 100644 --- a/test/ng/directive/ngViewSpec.js +++ b/test/ng/directive/ngViewSpec.js @@ -63,7 +63,7 @@ describe('ngView', function() { }; module(function($compileProvider, $routeProvider) { - $routeProvider.when('/some', {templateUrl: '/tpl.html', controller: Ctrl, controllerAlias: 'ctrl'}); + $routeProvider.when('/some', {templateUrl: '/tpl.html', controller: Ctrl, controllerAs: 'ctrl'}); }); inject(function($route, $rootScope, $templateCache, $location) {