miguelcobain / ember-composability-tools

ember-composability-tools - Helpers for building a somewhat different kind of components.
MIT License
39 stars 18 forks source link

What if I have a parent which is a child as well? #13

Closed nizarayari closed 2 years ago

nizarayari commented 6 years ago
              parent1
                   |
       parent2 and child1
    |             |             |
child 2     child3    child4

I want to iterate through my childs component in parent 1 and parent 2

lolmaus commented 6 years ago

The readme says:

Note that a component can be a child and a parent at the same time. e.g marker-layer is a child to leaflet-map but a parent to popup-layer. In that case just include both mixins. They are compatible.

miguelcobain commented 2 years ago

Currently, you just need to have a <Root> component at the root of the chain. Otherwise, you can arbitrarily nest <Node> components, which means that they can be a parent and a child.