new IgxStylesRegistrar(): IgxStylesRegistrar

Returns IgxStylesRegistrar

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: symbol

    A module-level Symbol that uniquely identifies the stylesheet.

  • css: string

    The CSS string to register (typically a generated *.styles.ts export).

Returns void

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);