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

Re : Question about binding in Observe List.

$
0
0
You need to share the same instance of can.Observe list between your controls. The easiest way is passing them as options:

  1. 'init': {
  2.     this.items = can.Observe.List([]);
  3.     this.items.attr(getFromSomewhereAListOfObjects);
  4.     this.b = new B({
  5.      items: this.items
  6.     });
  7. }
Now you can access `this.options.items` in Control B e.g. do something like
  1. this.items = this.options.items;
During initialization.

Viewing all articles
Browse latest Browse all 3491

Trending Articles