Skip to content

SiDirectionality Service documentation

import { SiDirectionality } from '@siemens/element-ng/localization';

Provider for dynamic CDK directionality.

CDK per default evaluates directionality once during initialization. This is a problem when switching language later in the lifecycle. This provider can be used to make this dynamic. To use, simply provide this in the ApplicationConfig:

import { Directionality } from '@angular/cdk/bidi';
import { SiDirectionality } from '@siemens/element-ng/localization';

...
export const APP_CONFIG: ApplicationConfig = {
  providers: [
    { provide: Directionality, useClass: SiDirectionality },
    ...
  ]
}

bootstrapApplication(AppComponent, APP_CONFIG)
   ...

Attributes and Methods

Name Type Default Description
(readonly)change
EventEmitter<Direction> new EventEmitter<Direction>()

Stream that emits whenever the 'ltr' / 'rtl' state changes.

Implements Directionality

(readonly)value
Direction

The current 'ltr' or 'rtl' value.

Implements Directionality

(readonly)valueSignal
WritableSignal<Direction> 'ltr'

The current 'ltr' or 'rtl' value.

Implements Directionality


Except where otherwise noted, content on this site is licensed under MIT License.