This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
$watching functions which return a deferred/promise #3503
Closed
Description
If I $watch a promise it will treat what the promise is resolved with as the value to watch, which is good. If, however, I $watch a function returns that same promise, $digest handles the promise like a plain object which causes the watch not to trigger on resolve, and anything relying on the watch for the output value (e.g. ng-bind) will receive the promise object instead of the value it was resolved with.
Fiddle (outputs to console)
The check for deferred/promise is in getterFn and that's never used for function calls, should there be a check to see if the value of the expression is a deferred/promise in $digest?
Metadata
Metadata
Assignees
Labels
No labels