![]() async update) and then reset the disabled states after the async operation is completed. If we can revert to the input disabled value, we can build forms that enforce a state during a certain process (e.g. ![]() What is the motivation / use case for changing the behavior? All that said, I'm not sure HTML allows disabling a form. But since it returns cond, all you actually need is disabled'cond'. The "always disabled" input cannot be reset. All your function needs to do is to return true or false. The plnkr has two inputs: one "regular" and one is always disabled.Ĭlick the submit button -> both inputs get disabled.Īfter the timeout -> both inputs get enabled. Minimal reproduction of the problem with instructions This content highlight a simple solution to enable/disable a FormGroup in Angular. ![]() a method on AbstractControl to reset the disabled state.a "force" option in disable() and enable().the most specific attribute ( on the input) could take precedence.There could be multiple solutions to this: Even the second form which has disabled="true" hard-coded gets enabled and there is no way to get it back to its self-governing state. ![]() When doing this, first all controls get disabled, then all get enabled.
0 Comments
Leave a Reply. |