Description
When using kendo-dateinput together with the new [formField] binding (Angular signal-based forms) instead of a Reactive Forms FormControl, the component throws an unhandled TypeError during initialization:
TypeError: Cannot read properties of undefined (reading 'subscribe')
Root cause
In DateInputComponent.ngAfterViewInit, the following line assumes this.formControl is always a Reactive Forms FormControl (or null), and unconditionally accesses .statusChanges:
this.subs.add(this.formControl?.statusChanges.subscribe(() => this.setAriaInvalid()));
The optional chaining (?.) only guards against this.formControl itself being null/undefined — it does not guard against this.formControl existing but statusChanges being undefined. When the component is bound via [formField] instead of [formControl]/formControlName, this.formControl.statusChanges is undefined, so .subscribe(...) is called on undefined and throws.
Steps To Reproduce
- Create a component using Angular signal forms with
[formField].
- Bind
kendo-dateinput to that field via [formField] instead of a Reactive Forms FormControl.
- Load the component.
Screenshots or video
Actual Behavior
Component throws TypeError: Cannot read properties of undefined (reading 'subscribe') at runtime, breaking initialization.
Expected Behavior
DateInputComponent should not throw when used with [formField]. Either:
- Guard the subscription with a check for
statusChanges existing (e.g. this.formControl?.statusChanges?.subscribe(...)), or
- Detect the binding type and use the appropriate mechanism to react to validity/status changes for signal-based forms.
Browser
Chrome
Browser version
latest
OS type
MacOS, Windows
OS version
No response
Last working version of the Kendo UI for Angular package (if regression).
No response
Description
When using
kendo-dateinputtogether with the new[formField]binding (Angular signal-based forms) instead of a Reactive FormsFormControl, the component throws an unhandledTypeErrorduring initialization:TypeError: Cannot read properties of undefined (reading 'subscribe')Root cause
In
DateInputComponent.ngAfterViewInit, the following line assumesthis.formControlis always a Reactive FormsFormControl(ornull), and unconditionally accesses.statusChanges:The optional chaining (
?.) only guards againstthis.formControlitself beingnull/undefined— it does not guard againstthis.formControlexisting butstatusChangesbeingundefined. When the component is bound via[formField]instead of[formControl]/formControlName,this.formControl.statusChangesisundefined, so.subscribe(...)is called onundefinedand throws.Steps To Reproduce
[formField].kendo-dateinputto that field via[formField]instead of a Reactive FormsFormControl.Screenshots or video
Actual Behavior
Component throws
TypeError: Cannot read properties of undefined (reading 'subscribe')at runtime, breaking initialization.Expected Behavior
DateInputComponentshould not throw when used with[formField]. Either:statusChangesexisting (e.g.this.formControl?.statusChanges?.subscribe(...)), orBrowser
Chrome
Browser version
latest
OS type
MacOS, Windows
OS version
No response
Last working version of the Kendo UI for Angular package (if regression).
No response