Open adamdport opened 6 years ago
It seems to be more natural to use formArray
instead of formControl
I am facing the same issue! Whenever I use formcontrol with mat-select in multiple mode it works when the initialized value is null but not with an initialized value as array
Have same issue. And it should support both individual (boolean valued) form controls on each option, and a form array of such controls. Sometimes you might not want to collect the values in an array, but as properties on an object (form group).
Bug, feature request, or proposal:
feature request
What is the expected behavior?
mat-select
inmultiple
mode lets me putformControls
on individual optionsWhat is the current behavior?
I have a list of boolean options (checkboxes) that a user can set.
formControl
only works on the mat-select, which is populated with an array. If I want to prepopulate those, I need to manually build an array to set on mymat-select
. I cannot bind tovalueChanges
on individual options.What is the use-case or motivation for changing an existing behavior?
Manually keeping this array updated and in sync with my individual settings is painful. I'd rather create
formControl
s for each option, which I can bind to and set/patch as I need to. Perhaps let me set aformGroup
on themat-select
instead of aformControl
?Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?