MCPcopy Create free account
hub / github.com/angular/components / FakeDirectionality

Class FakeDirectionality

src/cdk/testing/private/fake-directionality.ts:17–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15// Implementing the interface ensures the fake stays in sync with the real API.
16// tslint:disable-next-line:no-undecorated-class-with-angular-features lifecycle-hook-interface
17@Service()
18class FakeDirectionality implements Directionality, OnDestroy {
19 readonly change: EventEmitter<Direction>;
20
21 get value(): Direction {
22 return this.valueSignal();
23 }
24
25 constructor(readonly valueSignal: WritableSignal<Direction>) {
26 this.change = toObservable(valueSignal).pipe(skip(1)) as EventEmitter<Direction>;
27 }
28
29 ngOnDestroy() {}
30}
31
32export function provideFakeDirectionality(direction: Direction | WritableSignal<Direction>) {
33 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected