From c057f2385d663fb11c0d3fd38656e9e39fec2d11 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 1 May 2015 15:00:01 +0300 Subject: [PATCH] fix(nav): Support `controllerAs` syntax (#3058, #2499) in ion-nav-view --- js/angular/controller/navViewController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/angular/controller/navViewController.js b/js/angular/controller/navViewController.js index 88d693c6fca..05bc2de5653 100644 --- a/js/angular/controller/navViewController.js +++ b/js/angular/controller/navViewController.js @@ -267,6 +267,9 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate, if (viewLocals && viewLocals.$$controller) { viewLocals.$scope = viewScope; var controller = $controller(viewLocals.$$controller, viewLocals); + if (viewLocals.$$controllerAs) { + viewScope[viewLocals.$$controllerAs] = controller; + } $element.children().data('$ngControllerController', controller); }