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.
the watch would keep track of age property of each item in the users collection and it would fire if a value of this property on any of the user object changes or when a user object is added or removed added to/from the collection.
the newVal and oldVal would be an array of age values with indexes matching the current order of items in the users array.
so during the first digest the watch would fire with these values:
newVal = [33, 22, 11];
oldVal = NaN;
if a new user with age 44 is appended to the array the watch would then fire with:
newVal = [33, 22, 11, 44]
oldVal = [33, 22, 11];
if the only user with age 44 is then updated to 55 the watch would fire with:
notice that the oldVal contents were reordered, to match the new order of elements in the users array as well as newVal array. this is necessary for enabling developers to figure out the actual change (newVal[0] vs oldVal[0]).
implementation notes: it should be possible to reuse hashKeys just like what repeater does to implement this watcher.