How come myCtrl.greeting doesn't automatically update when I change myCtrl.name?
angular.module('MyApp', [])
.controller('MainController', [function(){
var mCtrl = this;
mCtrl.name = '';
mCtrl.greeting = 'Greetings ' + mCtrl.name;
}]);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="MyApp" ng-controller="MainController as mCtrl">
<input type="text" ng-model="mCtrl.name">
<h3 ng-bind="mCtrl.greeting"></h3>
</div>
I assumed that updating the mCtrl.name property would trigger a $digest loop and update mCtrl.greeting in the view?