These are chat archives for canjs/canjs

8th
Jan 2018
Gregg Roemhildt
@roemhildtg
Jan 08 2018 19:53
hey yall, trying to make some planning decisions and am wondering, can slots be nested? Like can I put one can-slot inside another?
Chasen Le Hara
@chasenlehara
Jan 08 2018 20:04
When you say nested, does that mean having a slot as the default content for another slot?
Gregg Roemhildt
@roemhildtg
Jan 08 2018 20:07
Something like this:
<can-slot name="editPage">
    <can-slot name="editHeader" />
    <can-slot name="editFooter" />
</can-slot>

<can-slot name="createPage">
...
</can-slot>
So one could override the entire "editPage" slot, or just parts of it
Chasen Le Hara
@chasenlehara
Jan 08 2018 20:09
Ooo interesting, I’m not sure, let me give it a spin in a JS Bin and see if it works
I’m trying to think of a good reason why it shouldn’t support this…
Gregg Roemhildt
@roemhildtg
Jan 08 2018 20:17
Okay, yeah I was just curious.
I think there's a lot of untapped functionality in can-slot
Chasen Le Hara
@chasenlehara
Jan 08 2018 20:20
Yeah, to me this feels like something that should be supported.
Gregg Roemhildt
@roemhildtg
Jan 08 2018 20:20
Some template languages support the concept of nested slots and it makes the templates much more reusable. The one I linked is server side though, I'm not really sure what impact it would have on performance
Sure, will do
Gregg Roemhildt
@roemhildtg
Jan 08 2018 20:29
canjs/can-component#193
Chasen Le Hara
@chasenlehara
Jan 08 2018 20:31
👍 Thank you