The $timeout Service
The$timeout
service is AngularJS' version of the
window.setTimeout
function.Example
Display a new message after two seconds:var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $timeout) {
$scope.myHeader = "Hello World!";
$timeout(function () {
$scope.myHeader = "How are you today?";
}, 2000);
});