| 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 |