Constructors
Section titled "Constructors"IgxStylesRegistrar
Section titled "IgxStylesRegistrar"new IgxStylesRegistrar(): IgxStylesRegistrar Returns IgxStylesRegistrar
Methods
Section titled "Methods"register
Section titled "register"Registers a stylesheet identified by id. Subsequent calls with the same
id (against the same document) are no-ops, so it is safe to call from every
component instance.
register(id: symbol, css: string): void Defined in projects/igniteui-angular/core/src/services/styles/styles-registrar.service.ts:47
Parameters
- id:
symbolA module-level
Symbolthat uniquely identifies the stylesheet. - css:
stringThe CSS string to register (typically a generated
*.styles.tsexport).
Returns void
retain
Section titled "retain"Keeps the components' styles in the document for the application's lifetime, through a detached instance of each. Otherwise Angular removes them with the last instance and re-inserts them with the next one, restyling the page each time.
retain(components: Type<unknown>[]): void Defined in projects/igniteui-angular/core/src/services/styles/styles-registrar.service.ts:82
Parameters
- components:
Type<unknown>[]The components whose styles to retain.
Returns void
Example
inject(IgxStylesRegistrar).retain(IgxBadgeComponent, IgxChipComponent);