diff --git a/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts index 35e3e7b5233..1a459659b18 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts @@ -3015,9 +3015,9 @@ describe('type check blocks', () => { expect(block).toContain('_t2.field = (((this).f));'); }); - it('should generate a string field for a select', () => { + it('should generate a string | number | null field for a select', () => { const block = tcb('', [FieldMock]); - expect(block).toContain('var _t1 = null! as string;'); + expect(block).toContain('var _t1 = null! as string | number | null;'); expect(block).toContain('_t1 = ((this).f)().value();'); expect(block).toContain('var _t2 = null! as i0.FormField;'); expect(block).toContain('_t2.field = (((this).f));'); diff --git a/packages/compiler/src/typecheck/ops/signal_forms.ts b/packages/compiler/src/typecheck/ops/signal_forms.ts index 94f0db1bd73..4ebe8d653a5 100644 --- a/packages/compiler/src/typecheck/ops/signal_forms.ts +++ b/packages/compiler/src/typecheck/ops/signal_forms.ts @@ -169,11 +169,15 @@ export class TcbNativeFieldOp extends TcbOp { } private getExpectedTypeFromDomNode(node: Element): string | null { - if (node.name === 'textarea' || node.name === 'select') { - // `