You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Apparently $onChanges hook it's not called when bindings are updated through a resolved Promise or better it's called only when bound objects are assigned at least twice or when the HTML DOM undergoes a change or an update.
Expected / new behavior:
$onChanges should be triggered when the Promise got resolved.
Minimal reproduction of the problem with instructions:
"Hover" button will add a class "red" on the element when the cursor is hover it. In this way DOM get changed.
Tests cases
Click once on Async button
$onChanges will be not fired even when the promise got resolved. By hovering with the cursor to the "Hover" button $onChanges hook get fired.
Click twice on Async button
$onChanges will be fired only on the second attempt and will display the first resolved promise. By hovering with the cursor to the "Hover" button will be fired the second resolved promise and so on...
Click thrice or more on Async button
You can notice that after the second attempt seems that $onChanges is always fired, but it left a promise behind, in fact after clicking multiple times on "Async" button and than hovering on "Hover" button $onChanges detects one more change.
AngularJS version: 1.6.9
Browser: all
Anything else:
This issue is not reproducible when the promise is coming form $resource and $http providers.