I\'m doing array mutation with Polymer\'s array mutation methods.
this.allRules = [{name: \"abc\", enabled: true}];
var item = this.allRules[index
Actually the item should be removed from the array. The second time it logs out as [splices: Object]
just to show more info about this array, as it has a property called splices. If you run the same thing in Firefox you will still see [object]
so I guess this is just a Chrome console helper thing.
To get the value to be updated, one way is to wrap the this.push
call inside a this.async
method.
this.async(function() {
this.push('allRules', item);
console.log(item);
console.log(this.allRules[0].name);
// returns 1, meaning it's filled with one item again
console.log(this.allRules.length);
});
Have a look at this plunker for a working sample.