dynamically naming multiple slots in aurelia view -
in aurelia have created custom element interacts container. container creates ui elements around child nodes.
these custom elements can used in view 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 wizard-container
class read children @children('wizard-step') steps = [];
, loop on them in template:
... <div class="step" repeat.for="step of steps"> <slot name="step-${$index}"><p>slot-${$index}</p></slot> </div> ...
the problem slots not going created.
i'm not able add element these slots this
<template slot="slot-${idx}"> <p>hello world</p> </template>
according blog post may 2016 data binding slot's name
attribute , slot
attribute not working.
does knows if possible or has idea workaround?
this not possible slots, unfortunately. isn't possible due limitations of shadow dom spec.
you might @ replaceable parts see if can need do: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/cheat-sheet/9
scroll down bit , you'll see information on replaceable parts. being said, i'm not sure if work you. i've never tried using dynamically named template parts.
Comments
Post a Comment