Reputation: 383
Now I have defined a collection, and bond both add and change event listener, but when a new model is added, the change event will be triggered.
collection.bind('add',addMethod);
collection.bind('change',changeMethod);
How can I avoid triggering change event?
Upvotes: 0
Views: 105
Reputation: 485
As mentioned in comments, when you add something to your collection, add silent-option to that function-call. Check Backbonejs reference for more info.
collection.add(someModel, {silent: true});
Upvotes: 1