This article was useful to me, it covers both the method of registering an observer and the methods of splicing, as suggested by Justin XL.
Observer Registration :
properties: { users: { type: Array, value: function() { return []; } } }, observers: [ 'usersAddedOrRemoved(users.splices)' ],
Calling splicing methods using Polymer 1.0:
this.push('users', 'TestUser');
https://www.polymer-project.org/1.0/docs/devguide/properties.html#array-observation
FYI - this will NOT work in all cases (my initial idea) When you register an observer in a property declaration as follows:
properties: { users: { type: Array, value: function() { return []; }, observer: 'usersAddedOrRemoved' } },
In this case, the usersAddedOrRemoved method usersAddedOrRemoved called only when a new array is assigned to the user object. However, it will not fire when you mutate an array by clicking, popping, splicing, etc.
source share