Leonardo Ferreira Leonardo Ferreira - 5 months ago 15
Javascript Question

Aurelia's Component Not Being Replace By Its Template

Why dont Aurelia's custom elements get replace by its template, instead of being put inside it?

Example:

I want this

<sidebar-item label="Dashboard" href="#" icon="icon-home4"></sidebar-item>


to be replaced by this

<li class="active">
<a href="index.html">
<i class="icon-home4"></i>
<span>Dashboard</span>
</a>
</li>


but instead, the result is this:

<sidebar-item label="Dashboard" href="#" icon="icon-home4">
<li class="active">
<a href="index.html"><i class="icon-home4"></i> <span>Dashboard</span></a>
</li>
</sidebar-item>


Is there a way to replace the custom tag for its template?

Answer

Basically add @containerless to the view-model of SidebarItem.

Comments