function Ctrl($scope) { $scope.message = "Waiting 2000ms for update"; setTimeout(function () { $scope.message = "Timeout called!"; // AngularJS unaware of update to $scope }, 2000); }
<div ng-app ng-controller="Ctrl"> {{message}} </div> <!-- app and ctrl in same dom, doesn't update, need apply -->
</style> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script> <style>