Files

41 lines
885 B
Markdown
Raw Permalink Normal View History

@name Invalid Shadow DOM selector
@category compiler
@shortDescription Component selector does not match shadow DOM requirements
@description
2022-03-10 08:48:09 -08:00
The selector of a component using `ViewEncapsulation.ShadowDom` doesn't match the custom element tag name requirements.
In order for a tag name to be considered a valid custom element name, it has to:
2022-03-10 08:48:09 -08:00
* Be in lower case.
* Contain a hyphen.
* Start with a letter \(a-z\).
@debugging
Rename your component's selector so that it matches the requirements.
**Before:**
2022-03-10 08:48:09 -08:00
<code-example format="typescript" language="typescript">
&commat;Component({
selector: 'comp',
encapsulation: ViewEncapsulation.ShadowDom
2022-03-10 08:48:09 -08:00
&hellip;
})
2022-03-10 08:48:09 -08:00
</code-example>
**After:**
2022-03-10 08:48:09 -08:00
<code-example format="typescript" language="typescript">
&commat;Component({
selector: 'app-comp',
encapsulation: ViewEncapsulation.ShadowDom
2022-03-10 08:48:09 -08:00
&hellip;
})
2022-03-10 08:48:09 -08:00
</code-example>