These are chat archives for canjs/canjs

Nov 2017
Nov 01 2017 08:18

hi all i have a question
for example i have a component structure like

<app> -> <page> -> <section> -> ...-><someList>-> <someCard>
for example i also have a popup which is placed somwhere inside <app> or <page> for example

<app> -> <popup>
and now on click somewhere inside the <someCard> component i need to pass some data to the <popup>. what is the best way to do it with canjs.

Nov 01 2017 09:16
i know that for simple things we can use route. but if it something more complex what should i do?
Generating events on viewModels seems not the best solution if component chain is big enought
Chasen Le Hara
Nov 01 2017 19:27
@AntonProkofyev Not sure if it’s possible to do this in your app, but I’ve worked on projects where each component “owned” the popups/notifications it had to show, so instead of having them at the root of the app they were contained within the components.
If that’s not an option, then maybe having some sort of shared/global module that manages the data would be ok…
cc @phillipskevin for some better ideas