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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -