Closed einsteinreloaded closed 6 years ago
I'm not certain of the question. You seem to be describing how backbone works:
From the docs on events http://backbonejs.org/#Events-catalog
"change" (model, options) — when a model's attributes have changed. "change:[attribute]" (model, value, options) — when a specific attribute has been updated.
Both of these events will always be triggered when an attribute changes
I am trying to write unit test cases and i was spying on trigger method of a model with sinon.stub. When i checked the triggerspy called numbers it showed me 2 and the call args were 'change:percentComplete' and 'change' events. I am using backbonejs with coffeescript.