| 929 | // The following tests are specifically not in the authoring subdirectory to ensure that AOT doesn't check (and throws) forbidden required reads. |
| 930 | it('should throw error if a required input is accessed too early', () => { |
| 931 | @Component({ |
| 932 | selector: 'input-comp', |
| 933 | template: 'input:{{input()}}', |
| 934 | }) |
| 935 | class InputComp { |
| 936 | input = input.required<number>({debugName: 'input'}); |
| 937 | |
| 938 | constructor() { |
| 939 | this.input(); |
| 940 | } |
| 941 | } |
| 942 | |
| 943 | @Component({ |
| 944 | template: `<input-comp [input]="value" />`, |