Mat input set disabled6/12/2023 ![]() I updated the FormGroup in the component to disable the FormControl, which has the desired effect of disabling the input, however, if you then get the value of the FormGroup using the disabled form control is no longer present. We recommend using this approach to avoid 'changedįorm = new FormGroup() Your component class, the disabled attribute will actually be set in If you set disabled to true when you set up this control in It looks like you're using the disabled attribute with a reactive formÄirective. However, if your datepicker is part of a reactive form the text element remains active and you get the following message from Angular: Add the disabled attribute to the input element = ![]() The Angular Material docs suggest you disable the text input in the following way: There are detailed instructions in the Angular Material 2 docs on how to disable different parts of the mat-datepicker however, these do not seem to cover how to disable the text input when it is part of a reactive form. ![]() I am using Angular Material 2's mat-datepicker and want the input element disabled so the user cannot edit the value using the text input.
0 Comments
Leave a Reply. |