angular.service.$defer

Description

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.

Dependencies

Usage

$defer(fn[, delay]);

Parameters

Returns

{*}

DeferId that can be used to cancel the task via $defer.cancel().

Methods