FormControls updateOn property should be able to set
See original GitHub issueπ feature request
Relevant Package
This feature request is for @angular/forms
Description
The only way to set a FormControlβs updateOn property is in the constructor. In my case Iβm writing an app and a library of controls for myself and my team to use. We have a set of custom validators that all are supposed to work with updateOn: 'blur'
and so in my BaseValidator (which all validators extend) I want to force updateOn: 'blur'
. However, the FormControl is defined in the app that consumes the BaseValidator.
Describe the solution youβd like
const fc = new FormControl('');
fc.setUpdateMethod('blur');
Describe alternatives youβve considered
Iβve tried to work around the issue by using setControl but to no avail.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5 (2 by maintainers)
Top Results From Across the Web
The updateOn Option in Angular Forms - InDepth.Dev
The FormControl will update itself only when the parent form is submitted. ... This is why the ability to set the updateOn property...
Read more >Not able to set input value, when I use 'updateOn' attribute ...
updateOne will only fire when the input is blurred, that's why you'll have to do: component.input(component.
Read more >FormControl - Angular
Tracks the value and validation status of an individual form control. ... this flag is set, the control will instead reset to the...
Read more >Boosting Performance With The New updateOn Option in ...
Luckily, Angular version 5 provides a new option that improves performance by delaying form control updates until the blur or the submit event....
Read more >5 tips on using Angular FormControl | by Alain Chautard
That's what the updateOn property is all about. We can delay the FormControl update process with one of these three options: blur β...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This would be very appreciated. As a workaround it is currently possible to do something like this
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.