Aurelia 2 containerless

I’ve noticed that the containerless attribute in Aurelia 2 doesn’t work as it did in Aurelia 1. Adding this attribute to my custom element doesn’t do anything

This:

<my-element prop1.bind="value" containerless></my-element>

still renders the my-element wrapper. Is there a different way of doing this in Au 2?

In the cheatsheet there is a example of with and without conventions under custom elements. Not sure if that would be what your looking for.

Thanks @airboss001, I saw that, but I want to declare it as an attribute on the HTML, not in the custom element’s view model. This is especially useful when defining and then using in-line custom elements.

Ok, worth a shot.
Did you see if the module version worked? Might be easy to add/create the custom attribute back if so perhaps?

I appreciate it’s not always equivalent, but we’ve found display: contents; has largely replaced containerless for us - where we were mostly needing to avoid the element existing because of CSS.

2 Likes