A controller that allows components to use the <slot> tag when their Shadow DOM
is disabled.
Limitations include all slot content must be wrapped in an element, e.g. text must be
in a <span> tag, and elements that Web Browsers will remove if not inside the
correct tag must be wrapped in a <template> tag, e.g. table rows. The content of a
<template> tag must also be wrapped in an element.
Example
In addition the typical host parameter, the controller constructor takes references
for all the slots it should control.
<element-with-slots> <template> <span>This will be placed in the unnamed slot and replace its default content</span> </template> <spanslot="named-slot">This will be placed in the named slot and replace its default content</span> </element-with-slots>
A controller that allows components to use the
<slot>
tag when their Shadow DOM is disabled.Limitations include all slot content must be wrapped in an element, e.g. text must be in a
<span>
tag, and elements that Web Browsers will remove if not inside the correct tag must be wrapped in a<template>
tag, e.g. table rows. The content of a<template>
tag must also be wrapped in an element.Example
In addition the typical
host
parameter, the controller constructor takes references for all the slots it should control.The above element can be used as follows: