Skip to content

Component decorator options

Kiran Mantha edited this page Mar 30, 2024 · 1 revision

Component decorator has following options:

Option Type Required Defaults Usage
selector string Yes true define the html selector for the component
root boolean No false set this to true if the component is root component of application
styles string or import() No '' define the styles for the component through a string or by dynamic import of stylesheet. allowed stylesheet extensions are scss, css, less.
Example of dynamic import:
  • for webpack template: styles: import('./base.scss')
  • for vite template: styles: import('./base.scss?inline')
deps Function[] No [] define the services as array
standalone boolean No false if true then the component is not affected by global styles. to make this work, shadowDomEncapsulation should be true
shadowDomEncapsulation boolean No true if true, component adopts browser's native shadowDom encapsulation else it resort to emulation. when set to false, ensure the styles are wrapped around :host selector. without this the component styles may not reflect properly