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 has been archived by the owner on Apr 12, 2024. It is now read-only.
What is the current behavior?
When a one-way bound array reference changes, even if the currentValue and previousValue pass the equality check of angular.equals(), it is still registered as a change.
This is causing my $onChanges even listener to fire even though the current and previous values are of the same type and of the exact same contents/properties.
I am not sure if this is intentional behaviour or a bug.
What is the expected behavior?
That this kind of change would not trigger the $onChanges event for that particular property, because, other than the reference to another object, nothing has in fact changed (array content wise).
What is the motivation / use case for changing the behavior?
My current work around is that I have to manually check the current/previous value with angular.equals() to make sure I don't mark the form dirty for no reason (it is used in a form control directive). This feels a bit redundant.
Which versions of Angular
Angular 1.5.6
The text was updated successfully, but these errors were encountered:
BTW, the possibility to add supporting for $watchCollection to one-way bindings is discussed in #14039 (as you already know 😉). It's not equivalent to deep-watching, but it is deeper than watching by reference.
What is the current behavior?
When a one-way bound array reference changes, even if the
currentValue
andpreviousValue
pass the equality check ofangular.equals()
, it is still registered as a change.This is causing my
$onChanges
even listener to fire even though the current and previous values are of the same type and of the exact same contents/properties.I am not sure if this is intentional behaviour or a bug.
What is the expected behavior?
That this kind of change would not trigger the
$onChanges
event for that particular property, because, other than the reference to another object, nothing has in fact changed (array content wise).What is the motivation / use case for changing the behavior?
My current work around is that I have to manually check the current/previous value with
angular.equals()
to make sure I don't mark the form dirty for no reason (it is used in a form control directive). This feels a bit redundant.Which versions of Angular
Angular 1.5.6
The text was updated successfully, but these errors were encountered: