I am trying to use the controllerAs
property on a $routeProvider
route without any success.
Here is the sample code:
var app =
The controllerAs
is an alias for the controller instance, if you would like to use that, you have to store data into the controller instance this
instead of $scope
:
app.controller('Ctrl', function($scope) {
var ctrl = this; // assign to a variable to be consistent when using in the template
ctrl.one = 'actual';
});
Example Plunker: http://plnkr.co/edit/r8AYtSKbiLQAaPBPriRp?p=preview