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/561225efbb51019451599a0545f4666beb215df3/libs/composables/class/src/provide-base-class.ts#L31)
Clone this wiki locally