Closed
Description
Bug, feature request, or proposal:
[x] Bug
What is the expected behavior?
You should be able to set the form control to disabled without setting the attribute in the HTML code (as angular complains if you set the disabled attribute when using reactive forms)
What is the current behavior?
It just silently fails to disable the control.
What are the steps to reproduce?
Just set the control to disabled when creating it or at any other time.
Reproduction here: http://plnkr.co/edit/RQBaGGe1p1jIBMv79Kgo?p=preview
What is the use-case or motivation for changing an existing behavior?
If you try to set disabled property using the attribute instead, angular will give a warning/error:
reactive_errors.js:30
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid 'changed after checked' errors.
Example:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
Which versions of Angular, Material, OS, browsers are affected?
Angular - 2.2.0
Material - Alpha-10
Metadata
Metadata
Assignees
Labels
No labels