These are chat archives for canjs/canjs

15th
Jan 2018
Nico R.
@nriesco
Jan 15 2018 01:26
what would be the recommended way of setting styles dynamically when using stache?
it seems to me that <div class=“class-one {{otherClasses}}”>text</div> could be a bad idea
maybe something like <div class:from=“myFunction”> would be better
Nico R.
@nriesco
Jan 15 2018 01:37

another question: if I have this object:

theObject = {
  foo: 'some value',
  var: 'foo'
}

// this works:
{{formatMe(theObject.foo)}}

// will this work? is it correct?
{{formatMe(theObject[var])}}

thanks

kostya.aderiho
@kaderiho
Jan 15 2018 09:47

Hi guys, is there a general approach for handling events in canjs application? I mean not using just only <my-component on:event="doSomething()"/> syntax.

So I have the next structure of components in DOM:

<component-1>
        <component-2>
            <component-3>
            </component-3>
       </component-2>
 <component-1>

The problem is that If I want to listen events from component-3 in component-1 I have to dispatch it in a component-2 and write a special method in viewModel for it