![]() Without readonly, we have to use (an ugly) work around and twist the behavior of disabled attribute + use getRawValue. In that case, it’d make sense to make some of the form controls readonly. Then disabled doesn’t come in handy as the disabled part of the form wouldn’t be sent. But then, we get a feature request where the user should be able to edit the form partially. Our option 1 would be to, in that context, set the form to be disabled which would indeed work fine. It’d have a cost to design and there’s no need to do that here really. After he saved it, he can see all the data and you don’t have a special component to only “display” the form values.Imagine you have a user logged in and you ask him to fill up a (pretty huge) form.Now, readonly is also part of that spec and I think this should be a major argument to have that integrated within Angular forms. Why should readonly be integrated into Angular IMO?Īs far as I can tell Angular has been trying to follow how forms are working in the browser and the disabled attribute is a good example of that. ![]() Not working on range, color, checkbox, radio, file, button Reading all the comments above, I agree to most of them but would like to add a little bit and try to summarize: Main differences
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |