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

Re : How do I do the equivalent of compute.on/compute.off while using can.Map.define?

$
0
0
Tom, in this case you can use .replace which accepts a deferred. it would be:

  1. pages: {
  2.   Value: Page.List,
  3.   get: function(value) {
  4.     value.replace(Page.findAll({}));
  5.     return value
  6.   }
  7. }

Notice that the Value key is capitalized. This means every time the Map is created pages will be initialized with new Page.List()

Viewing all articles
Browse latest Browse all 3491

Trending Articles