jeudi 11 juin 2015

Load and unload multiple components in a sidebar using Ember

I have a page where a user is building up an order for a customer. At various stages of the order they may get to a point where they need to add something else. For example, when selecting an address for the customer the customer may have a new address that needs adding, or an existing address may need editing.

I want to be able to load small components on the fly in a right hand sidebar, but there could be any number of them, so I can't just have something like

{{outlet 'right-hand-bar'}}

For example the user may have clicked to add an address, but then may also click a product in the order and I would want to show another component with details on the product, below the add address component. I guess it is kind of like master detail concept, but detail can contain multiple distinct details.

It doesn't feel right to just have a number of outlet's and use the next one available i.e.

{{outlet 'right-hand-bar1'}}
{{outlet 'right-hand-bar2'}}
...

Is there a way to do this in Ember CLI? X number of components in a single outlet?

Aucun commentaire:

Enregistrer un commentaire