In Aurelia I have created a custom element who interacts as a container. This container creates some ui elements around the child nodes.
These custom elements can be used in any view as follow:
<wizard-container ref="container">
<wizard-step title="Step 1" view-model="step1"></wizard-step>
<wizard-step title="Step 2" view-model="step2"></wizard-step>
<wizard-step title="Step 3" view-model="step3"></wizard-step>
</wizard-container>
In the wizard-container
class I read all children like this @children('wizard-step') steps = [];
and loop over them in the template:
...
<div class="step" repeat.for="step of steps">
<slot name="step-${$index}"><p>slot-${$index}</p></slot>
</div>
...
The Problem is that the slots are not going to be created.
I'm also not able to add any element to these slots like this
<template slot="slot-${idx}">
<p>hello world</p>
</template>
According to this blog post from May 2016 data binding to slot's name
attribute and to the slot
attribute is not working.
Does someone knows if it is now possible or has any idea for a workaround?