Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Correct replacing of list attribute while Model data update

$
0
0
What do you think about define plugin API that would allow to define a strategy for attributes merging?

For example something like that:

  1. var Todo = can.Model.extend({
  2.     define: {
  3.        users: {
  4.           merge: false, // that would prevent merging of the attribute, and would just set it instead.
  5.           replace: true // (intended to use for can.List attributes) that would prevent merge of the list and use replace with list
  6.        }
  7.     }
  8. },{   
  9.     
  10. });

Viewing all articles
Browse latest Browse all 3491

Trending Articles