Form manager plugin
This plugin simplifies working with Reactive Forms: https://angular.io/guide/reactive-forms It keeps in sync state and form values. To do this you need to access store either from actions either injected to component and do following:
where you myForm
looks like:
from now on all changes made in state will be reflected in form and visa-versa.
Form plugin returns object with two methods:
Reset - resets form to initial state
Destroy - method that should be called from your ngOnDestroy method
As a second parameter of bind
method some parameters can be passed:
debounceTime - time to wait until changes are synced. Default: 100ms
emitEvent - Angular pathValue parameter. Default: false. https://angular.io/api/forms/FormControl
Demo
Last updated