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

Class WriteComputed

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

Source from the content-addressed store, hash-verified

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

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