You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MatStepper] FormControlLike is not compatible with FormGroup #15859
The stepControl attribute of the CdkStep/MatStep classes should be castable to/assignable from a FormGroup or FormArray.
What is the current behavior?
Conversion of type 'FormControlLike' to type 'FormGroup' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Property 'controls' is missing in type 'FormControlLike'.
Happens during compilation when trying to cast FormControlLike to a FormGroup.
Type FormGroup is not assignable to type FormControlLike
Is the warning shown in HTML files when trying to assign a FormGroup to the stepControl input of a MatStep.
What are the steps to reproduce?
Create a MatStepper with a FormGroup assigned to a stepControl of one of the MatSteps. To reproduce the compilation issue, try to cast the stepControl of one step into a FormGroup within a TypeScript function.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material Version 7.3.7
Reacted by Karma, Julien Boulay, Florian Leger, Mou Nine, earshinov, Matiss Janis Aboltins, Shlomo Anglister, Daniel Mouritsen, Marcelo Botega Fontana, kpats and 5 more
This also causes massive problems under Ivy rendering. I have an Angular 8 project, and recently opted into Ivy rendering. Automatically every instance of [stepControl] that I was using in stepper threw errors because of me assigning a FormGroup instance to the [stepControl]. Ivy apparently is quite a bit more strict on validation - even more than traditional AOT has been. Since FormGroup doesn't have registerOnChange or registerOnDisabledChange, I'm basically stuck and cannot use both Ivy rendering and [stepControl], since there's no way I can see to treat my FormGroup as a FormControlLike, since FormControlLike is not exported.
Reacted by Soe Tun, Karma, derSoerrn95, rexsuecia, Matiss Janis Aboltins, Ihor Bobyr, kpats, Denis LE and Andrea
Activity
sumpton commentedon Apr 24, 2019
I have this error as well. It is possibly my editor, the latest WebStorm?
grubeninspekteur commentedon May 7, 2019
See also #15464 (comment)
Londovir commentedon Sep 13, 2019
This also causes massive problems under Ivy rendering. I have an Angular 8 project, and recently opted into Ivy rendering. Automatically every instance of [stepControl] that I was using in stepper threw errors because of me assigning a FormGroup instance to the [stepControl]. Ivy apparently is quite a bit more strict on validation - even more than traditional AOT has been. Since FormGroup doesn't have registerOnChange or registerOnDisabledChange, I'm basically stuck and cannot use both Ivy rendering and [stepControl], since there's no way I can see to treat my FormGroup as a FormControlLike, since FormControlLike is not exported.
shlomoa commentedon Nov 6, 2019
Appeared only after enabling ivy
latest material