In Angular 2+, is it possible to reset value of an input to its previous value programmatically?
I have 'Select' dropdown, whereupon selecting a value I need to reset its value to the previous one, if certain validation fails.
How can I achieve the same using ngModel (Template form) and formControl (Reactive Form)? (Just need to know if its possible by both the approaches).
I have figured out that if we place the ngModelChange event before the ngModel in the select tag in the template, the in the ngModelChange event we get value of ngModel prior to the change. Reference: https://github.com/angular/angular/issues/11234
But I think this approach is not concise and might be confusing at times.