#Get a components children without adding an element with a modifier

1 messages ยท Page 1 of 1 (latest)

weary echo
#

Is there a way to access a components children without adding an element with a modifier in ember like you can in react with the children prop.
When a component is hidden (via an {{#if}} for example it's replaced with a <!---> comment element. Is there a way to get that? Perhaps via the component manager or embers view registry or something?

ashen quail
#

I don't think so

#

why do you want magic access to elements? ๐Ÿ˜…

weary echo
#

I want to make an if component that animates it's child (only allows on child) using my own logic

#

And I would like to avoid having to add an element just to get the location of the components children in the dom

ashen quail
#

I think you have to use an element for that

weary echo
#

The problem is that an element, even if it has display:none styling, will affect collapsed margins ๐Ÿ˜ฆ

ashen quail
#

if your team adopts the philosophy of "components should not use margin for layout", then it's a non-issue ๐Ÿ˜…

#

layout is generally easier as wrappers, with grid/flex and gap, etc