MCPcopy Create free account
hub / github.com/angular/angular / TestCmp

Class TestCmp

packages/core/rxjs-interop/test/to_signal_spec.ts:306–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304 describe('in a @Component', () => {
305 it('should support `toSignal` as a class member initializer', () => {
306 @Component({
307 template: '{{counter()}}',
308 changeDetection: ChangeDetectionStrategy.OnPush,
309 standalone: false,
310 })
311 class TestCmp {
312 // Component creation should not run inside the template effect/consumer,
313 // hence using `toSignal` should be allowed/supported.
314 counter$ = new Subject<number>();
315 counter = toSignal(this.counter$);
316 }
317
318 const fixture = TestBed.createComponent(TestCmp);
319 fixture.detectChanges();

Callers

nothing calls this directly

Calls 2

ComponentInterface · 0.90
toSignalFunction · 0.90

Tested by

no test coverage detected