<body ng-app='MainApp'>
<div ng-controller='MainCtrl'>
<div>
<div>Controller1</div>
<input type='text' ng-model='text1'/>
<br/>
Text: {{text1}}
<br/>
<input type='button' ng-click='update();' value='Update Outside' />
</div>
</div>
</body>
var mainMod = angular.module('MainApp', []);
mainMod.controller('MainCtrl', ['$scope','$rootScope',
function ($scope,$rootScope) {
$scope.update = function(){
setTimeout(function(){
$scope.text1 = 'New Text';
$scope.$apply(); //removing this New Text won't be updated
},500);
}
}
]);
This Pen doesn't use any external CSS resources.