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

Class WriteComputed

packages/core/test/render3/reactivity_spec.ts:834–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

832
833 it('should disallow writing to signals within computed', () => {
834 @Component({
835 selector: 'with-input',
836 template: '{{comp()}}',
837 })
838 class WriteComputed {
839 sig = signal(0);
840 comp = computed(() => {
841 this.sig.set(this.sig() + 1);
842 return this.sig();
843 });
844 }
845
846 const fixture = TestBed.createComponent(WriteComputed);
847

Callers

nothing calls this directly

Calls 4

ComponentInterface · 0.90
signalFunction · 0.90
computedFunction · 0.90
setMethod · 0.65

Tested by

no test coverage detected