javascript - Backbone.Model. Replace attributes hash -
is there options
set
method or other way replace current attributes of model ones provided? here want:
var instance = new backbone.model(); instance.set({foo: 1}); instance.set({bar: 2}, {replace: true}); //just example console.log(instance.tojson()); //returns {bar: 2}
i guess looking this: http://backbonejs.org/#model-clear
instance.clear().set({bar: 2});
Comments
Post a Comment