$evalAsync([expression], [locals]);
Executes the expression on the current scope at a later point in time.
The $evalAsync makes no guarantees as to when the expression will be executed, only that:
- it will execute after the function that scheduled the evaluation (preferably before DOM rendering).
- at least one $digest cycle will be performed after
expressionexecution.
Any exceptions from the execution of the expression are forwarded to the $exceptionHandler service.
Note: if this function is called outside of a $digest cycle, a new $digest cycle will be scheduled. However, it is encouraged to always call code that changes the model from within an $apply call. That includes code evaluated via $evalAsync.
Parameters
| Param | Type | Details |
|---|---|---|
| expression (optional) | stringfunction() | An angular expression to be executed.
|
| locals (optional) | object | Local variables object, useful for overriding values in scope. |
Please login to continue.