Skip to content

@bynary.composables.class.Function.provideBaseClass

github-actions[bot] edited this page Jul 11, 2024 · 3 revisions

@bynary/composables / @bynary/composables/class / provideBaseClass

Function: provideBaseClass()

provideBaseClass(baseClass): object

Provide a base CSS class that should be applied to a host. The base class can be injected using the BASE_CLASS token. This token will be used by useModifier and useModifierGroup to generate modifier classes.

Parameters

baseClass: string

Returns

object

provide

provide: InjectionToken<string> = BASE_CLASS

useValue

useValue: string = baseClass

See

  • useModifier
  • useModifierGroup

Example

@Component({
   selector: 'my-component',
   providers: [
       provideBaseClass('my-component')
   ]
})
class MyComponent {
    baseClass = inject(BASE_CLASS); // 'my-component'
}

@param baseClass - The base class to provide.
@returns A provider for the {@link BASE_CLASS} token.

## Defined in

[class/src/provide-base-class.ts:31](https://github.com/bynaryDE/angular-extensions/blob/300e7e2a61055b2a862201157b9851536d259f80/libs/composables/class/src/provide-base-class.ts#L31)
Clone this wiki locally