Receiving data by clicking on a component


#1

Hello everyone! I am newbie in the world of the development of SPA and apologize in advance for a simple question.

I have two models: theme and collection, and they have relations: theme has many collections. On page /themes a user can see the component theme-card with theme. When he clicks on one of the cards, I must load nested resource - collection for clicked theme and render it with compoent collection-card. How I can do this, if components with following manuals shouldn’t load any external data?

Thank for your answers!


#2

If I understand this correct you just need to pass the models to the component just as post=post authors=authors in this example


#3

Thank you for your answer!

Ok, but how I can render only one group of nesten resources?

I need only one active (visible) group of collection-card component for selected theme, that will be loaded and shown only after clicking on theme-card component.


#4

That is how Ember works out of the box but if you need authors from the authors route in the post route you can use setupController like this:


#5

Thank you for your answers!