aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/ngView.js
diff options
context:
space:
mode:
authorMisko Hevery2013-04-29 14:27:45 -0400
committerMisko Hevery2013-04-29 14:28:54 -0400
commit400f9360bb2f7553c5bd3b1f256a5f3db175b7bc (patch)
tree1ffaaaacded8de30b66de384954f49366ec11b7e /src/ng/directive/ngView.js
parent7812ae75d578314c1a285e9644fc75812940eb1d (diff)
downloadangular.js-400f9360bb2f7553c5bd3b1f256a5f3db175b7bc.tar.bz2
fix(ngController): change controllerAlias to controllerAs.
Diffstat (limited to 'src/ng/directive/ngView.js')
-rw-r--r--src/ng/directive/ngView.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ng/directive/ngView.js b/src/ng/directive/ngView.js
index 8d7c87c5..d5ef2c71 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);
}