Is there a way to make the entire Angular form read only and then editable when clicking edit?
You can individually disable all the form elements as suggested in the current answer/comments, or you can wrap all of your form elements in a <fieldset>
(more info) tag and then enable/disable everything in one step:
<form>
<fieldset ng-disabled="myBooleanValue">
<input type="text">
</fieldset>
</form>
You can add ng-disabled="someBoolean"
to your form elements, and set someBoolean
to true
when you click a button.
https://docs.angularjs.org/api/ng/directive/ngDisabled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With