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
I've testing in 0.9.0-rc.1. I couldn't get events from a changed of array by Array mutation API. It seems that 'users-changed' event is not bind to the node. I confirmed that node.dispatchEvent is called but userAddedOrRemoved is never called until I binded users-changed event to the node in manually for testing. here is my test code and logs.
Polymer({
is: 'x-custom',
properties: {
users: {
type: Array,
value: []
}
},
observers: [
'usersAddedOrRemoved(users.splices)'
],
usersAddedOrRemoved: function(changeRecord) {
console.log('usersAddedOrRemoved', changeRecord);
},
addUser: function(user) {
this.push('users', user);
},
removeUser: function(user) {
var index = this.users.indexOf(user);
this.splice('users', index, 1);
}
});
var xs = document.querySelector('x-custom');
// usersAddedOrRemoved is not fired
xs.addUser('John');
xs.removeUser('John');
xs.fire('users.splices');
xs.fire('users.changed');
// usersAddedOrRemoved is fired
xs.addEventListener('users-changed', xs.usersAddedOrRemoved);
xs.addUser('John');
xs.removeUser('John');
The text was updated successfully, but these errors were encountered:
I've testing in 0.9.0-rc.1. I couldn't get events from a changed of array by Array mutation API. It seems that 'users-changed' event is not bind to the node. I confirmed that
node.dispatchEvent
is called butuserAddedOrRemoved
is never called until I bindedusers-changed
event to the node in manually for testing. here is my test code and logs.The text was updated successfully, but these errors were encountered: