sails.js - How do I add properties to a js-data object that I don't want persisted? -


i'm using js-data (and js-data-angular) in conjunction sockets via sails.js. when new item created/updated via sockets want call attention in ui.

i'd add "updated" property object, don't want inadvertently persist db.

is there way hang non-persisting properties on js-data object?

yes.

you can set globally on data store or per-resource using omit configuration setting. instance, when instancing data store, can instruct jsdata ignore properties begin underscore:

var store = new jsdata.ds({ omit: [ /^_/ ] }); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -