These are chat archives for canjs/canjs

Aug 2015
Andrei Balmus
Aug 18 2015 14:59

Gusy, please help: Is it possible to set current context to a custom attribut of the Component? just Like this:

    <product productdata={{.}}></product>

inside product Component I’m getting ‘[object Object]’ :(

oh forgot to tell you, I’m using stache
Aggelos Karalias
Aug 18 2015 15:03
@abalmush try productdata="{.}"
Andrei Balmus
Aug 18 2015 15:04
@mehiel ok thanks!
Andrei Balmus
Aug 18 2015 15:27
@mehiel, {.} doesnt work for me, it’s just renders ‘{.}'
I just created jsfiddle to test:
Aggelos Karalias
Aug 18 2015 15:36
that's because of prod: '@'
can you remove that and try again
Andrei Balmus
Aug 18 2015 15:37
sure one sec
yes it works now @mehiel thank you so much!!
Aggelos Karalias
Aug 18 2015 15:38

from viewModel's doc

Prototype properties that have values of "@" are not looked up in the current viewModel

Andrei Balmus
Aug 18 2015 15:41
allright, i used only string before so didnt have any issues, but now I need object and you save my life, thank you!
Aug 18 2015 20:18
quick question: would one produce zombie views if a components template changed? i have a large app which loads components only when needed and one parent component to manage that like so:
    tag: 'oa-articles',
    leakScope: true,
    scope: {
      // articles: <model>,
      request: compute(function () {
        var scope = this;
          categoryId: scope.attr('categoryId')
        }).then(function (articles) {
          scope.attr('articles', articles);
    events: {
      // request's dependency tracking for `categoryId` is only set-up when bound
      '{scope} request': function () {},

      '{scope} articles': function (ctx, evt, articles) {
        var $elem = this.element,
                tags = articles.pluck('tag');
        $.when( (tag) {
          return requestComponentByTag(tag);
        }).then(function () {
          $elem.html( (tag) {
            return '<'+tag+'></'+tag'>';