Vheissu / aurelia-for-real-world-web-applications-book-feedback

Post feedback as issues here on Github for the Aurelia book. Be as descriptive and honest as you like.
15 stars 0 forks source link

write that `if.bind` doesn't work on `<content>`and why #32

Closed opcodewriter closed 8 years ago

opcodewriter commented 8 years ago

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

Vheissu commented 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.

opcodewriter commented 8 years ago

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?

Vheissu commented 8 years ago

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.

opcodewriter commented 8 years ago

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

opcodewriter commented 8 years ago

I should change title maybe

opcodewriter commented 8 years ago

there's still an issue why if.bind doesn't work on <template> in Chrome, but this is unrelated I guess

Vheissu commented 8 years ago

Thanks @opcodewriter this is in the book, chapter 5.