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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -