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

Re : Passing a callback to a component - possible?

$
0
0

This is the way I have approached similar situations with nested components. Wire up the parts of the data model that a subcomponent can access, through the component's attributes. In this case I decided that "x-chooser" is responsible for setting a value on (what it sees as) "chosen", whereas outside that in the "main" Map, this value is "favoriteItem". You could imagine this is part of a form, where you might want multiple instances of "x-chooser" for different fields in the form. Of course, "favoriteItem" doesn't need to be on a Map, it could just as easily be a scope attribute on a parent component "x-profile-form".



Viewing all articles
Browse latest Browse all 3491

Trending Articles