These are chat archives for canjs/canjs

May 2016
Guido Smeets
May 09 2016 09:42
hmm, I need a reference to a dom node in my component's viewModel, anyone know if it's okay to do that? i.e.:
    inserted: { = this.element.find( ".foo");
   removed: { = null;
I'm a bit afraid of mem leaks
Jeroen Cornelissen
May 09 2016 09:52
@gsmeets I do the same thing…
inserted : {
    this.viewModel.attr(‘element’, this.element);
Justin Meyer
May 09 2016 14:33
Yeah, that's fine. I generally define that property's type as "*" then.
May 09 2016 19:27
@justinbmeyer @ccummings i see the repo canjs/can-devtools
but i cant get it running
is there a possible installation and usage guide?
Justin Meyer
May 09 2016 20:53
You can add it as a "load unpacked extension"
@ccummings and alexis are working on it this week
May 09 2016 20:54
hmm i cant get it working
i getting a error for $.extend is not defined
it seems jquery is not working
or something else
Guido Smeets
May 09 2016 21:42
can I create an event binding with arguments that are defined only on the child component, not on the parent?
Guido Smeets
May 09 2016 21:47
or can I somehow dispatch an event on a can.Map with extra parameters that are passed on
May 09 2016 22:09
@gsmeets when you trigger the event (assuming can.trigger), you can pass custom values on the event object and then access them in the binding syntax with %event,js,console,output
May 09 2016 22:14
@dylanrtt jesus, this is crazy :)
Guido Smeets
May 09 2016 22:33
@dylanrtt thx
that's slightly better than what I concocted now:
<my-component {^foo}="*foo" {fooEvent}="*otherComponent.setFoo(*foo)" />
and that times three, because I wasn't able to generalize the event parameter
thanks a bundle