Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : can.Component external events

$
0
0
Thanks this helps a bit more.

When rendering the top component, the child components are created and the 'selected' attribute is set accordingly.

Still I am not sure how this helps. How can the child components know that 'selected' attribute has changed?
To make this useful it should trigger some event in the child components, but I don't know of any attribute based events (except input/select 'value' attribute).

And if I get that problem solved then there is the question about how to actually pick up the 'selected' attribute? I assume I have to access it through this.element but I'm not exactly sure how.

In a different post, Justin said "A parent component can pass a shared observable to the child"...is that what I'm doing here?
I think I'm passing 'selected' to the child component, but how am I able to observe and detect that it changes? I wish there was some better documentation about this subject as the current docs really only describes standalone components.


Viewing all articles
Browse latest Browse all 3491

Trending Articles