These are chat archives for canjs/canjs

4th
Sep 2017
Frank Lemanschik
@frank-dspeed
Sep 04 2017 10:28
are there Instructions for binding a file fild?
Nico R.
@nriesco
Sep 04 2017 15:24
quick question:
Is there any difference when modifying a viewmodel's property using this two?
this.viewModel.myProperty = 123;
this.viewModel.set('myProperty', 123);
they both seem to work but there might be something I’m missing
@frank-dspeed you mean you need to uplaod a file?
Frank Lemanschik
@frank-dspeed
Sep 04 2017 15:27
wanted only to get file infos from the selected files fild
Nico R.
@nriesco
Sep 04 2017 15:33
what is “fild”?
Jeroen Cornelissen
@jeroencornelissen
Sep 04 2017 18:00
@nriesco with .set you can assign a property on a map that wasn’t predefined.
Nico R.
@nriesco
Sep 04 2017 18:01
@jeroencornelissen with not predefined you mean declared? or that didn’t have a value/default-value before?
Jeroen Cornelissen
@jeroencornelissen
Sep 04 2017 18:02
prop that wasn’t declared
Nico R.
@nriesco
Sep 04 2017 18:03
ok, I see.. thanks! @jeroencornelissen
Szabolcs Schmidt
@sszabolcs
Sep 04 2017 19:57

Hi!

I'm using CanJS 3. I would like to call a method on or send event to a child component from a parent component. What is the preferred/recommended way to do this?? Thanks a lot!

Frank Lemanschik
@frank-dspeed
Sep 04 2017 20:02
setting a value on parent that is binded to the child component or leaked would be sufficent
Szabolcs Schmidt
@sszabolcs
Sep 04 2017 20:04
bind on the change of the value on child side?
Szabolcs Schmidt
@sszabolcs
Sep 04 2017 20:11
@frank-dspeed: Do you know why there is not an option for sending events to child components? I'm asking this because there is an easy way to send events from the child to the parent. It's is a little bit strange for me. But there must be a reason why this way is not implemented. Anyway, thank you for the answer!
Nico R.
@nriesco
Sep 04 2017 23:00
@sszabolcs why would you need to send an event? you can catch the event in the child and with the binding from child to parent you can trigger something in the parent. You can also bind functions (I’ll search the syntax)
as far as I understand the “correct” way is using bindings
{^@child-funct}=“parentFunct” => https://canjs.com/doc/legacy_%7B($%5E)%7D_bindings.html
not sure how the new syntax would be => https://canjs.com/doc/can-stache-bindings.html