$defer
(service in module ng
)
Delegates to $browser.defer
, but wraps the fn
function
into a try/catch block and delegates any exceptions to
$exceptionHandler
service.
In tests you can use $browser.defer.flush()
to flush the queue of deferred functions.
$defer(fn[, delay]);
fn – {function()} –
A function, who's execution should be deferred.
delay(optional=0) – {number=} –
of milliseconds to defer the function execution.
{*}
– DeferId that can be used to cancel the task via $defer.cancel()
.
Cancels a defered task identified with deferId
.
deferId – {*} –
Token returned by the $defer
function.
{boolean}
– Returns true
if the task hasn't executed yet and was successfuly canceled.