Angularjs Examples

AJS Examples


AngularJS $timeout Service

The AngularJS $timeout service is similar to JavaScript's window.setTimeout function. In angular it is refer to it through the $timeout service. The $timeout is just wrapper for window.setTimeout function so that it will be easy to override, remove or mocked for testing. The AngularJS $timeout service return promise which can be used to cancel the $timeout task.

The $timeout service is executed provided function on every delay milliseconds.

Syntax

AngularJS $timeout Service Example