Closed opcodewriter closed 8 years ago
Worth noting that if.bind
does indeed work on the <compose>
element. I am currently using it in a report builder style application to conditionally show a properties panel for my widgets.
Now I'm confused.
According to Rob's comment only 25 days ago if.bind shouldn't work on <compose>
https://github.com/aurelia/templating/issues/271#issuecomment-186368960
This is confirmed to me also https://gist.run/?id=5bfe31c3e031da2d2af9
Moreover, if.bind
on <template>
part works only in FireFox, in Chrome it doesn't work:
https://gist.run/?id=0ec28f7c36833e2508c1
So which way is it?
I think you're confusing content with compose. The content element is a Shadow DOM feature which can also be used by standard elements. The compose element is for dynamically rendering views/view models. The content element definitely will not work with if because it's a slot for content.
sorry, my bad. I don't know why I got so confused. I think I was referring to <content>
actually not <compose>
that's why initially I mentioned about shadow DOM
I should change title maybe
there's still an issue why if.bind
doesn't work on <template>
in Chrome, but this is unrelated I guess
Thanks @opcodewriter this is in the book, chapter 5.
I think it's worth writing that
if.bind
doesn't work on<content>
and why but it works with template parts.See https://gist.run/?id=5bfe31c3e031da2d2af9
Since this involves shadow DOM, it's a good opportunity to talk about shadow DOM a bit, which is an important featured used by Aurelia