I have a pretty simple collection, but I can't seem to bind to it's change event. In Chrome's console, I'm running:
var c = new AwesomeCollection();
c.bind("change", function(){
console.log('Collection has changed.');
});
c.add({testModel: "Test"}); // Shouldn't this trigger the above log statement?
Since this is one of those things that can be difficult to track down, I doubt anybody knows off the top of their head what's going on (if so, great!). So, I'm asking two questions:
- Should the above code work as anticipated?
- If so, do you have any suggestions on how to track down where this would fail?
Thanks
question from:https://stackoverflow.com/questions/8175054/backbone-js-collections-change-event-isnt-firing