Found a strange behavior when using if.bind
inside a nested template tag that is itself projected into a component’s slot.
Basically the html structures below:
app.html
<template>
<component>
<template>
<div if.bind="expr">
</div>
</template>
</component>
</template>
component.html
<template>
<slot></slot>
</template>
(I omitted a if.bind
on the nested template tag that is required otherwise that tag never renders, it would be interesting to know why this requirement exists, but it is not the main question)
The binding only works (as in 'dynamically updates according to the current value of expr
') if expr
initially resolves to false
, if it initially resolves to true
the binding seems to be ignored.
gist:
I was wondering why that happens? Can templates be used like this?
Thanks.