Exclude model properties when syncing (Backbone.js)

后端 未结 11 1410
甜味超标
甜味超标 2020-12-07 14:26

Is there a way to exclude certain property from my model when I sync?

For example, I keep in my model information about some view state. Let\'s say I have a picker m

11条回答
  •  眼角桃花
    2020-12-07 14:28

    Having this same issue, I decided to create a small module that can help : https://github.com/lupugabriel1/backbone-model-save

    This is how you can use it in your models:

    var myModel = new Backbone.ModelSave.extend({
        notSync: ['name', 'age']
    });
    

提交回复
热议问题