AUR0706
Template compilation error: detected projection with [au-slot="yyyy"] attempted on a non custom element zzzz.
Last updated
Was this helpful?
Was this helpful?
<!-- plain-template.html (Not a custom element template) -->
<template>
<div>
<!-- Error: Cannot use au-slot here because the parent template is not a custom element -->
<span au-slot="header">This won't work</span>
</div>
</template><!-- my-card.html (Custom Element Template) -->
<template>
<div class="card">
<div class="card-header">
<slot name="header">Default Header</slot> <!-- Slot defined -->
</div>
<div class="card-body">
<slot>Default Body</slot> <!-- Default slot defined -->
</div>
</div>
</template>
<!-- usage.html -->
<template>
<require from="./my-card"></require>
<my-card>
<!-- Correct: Projecting into the 'header' slot of my-card -->
<span au-slot="header">Card Title</span>
<!-- Correct: Projecting into the default slot of my-card -->
<p>This is the card body content.</p>
</my-card>
</template>