0.1.0 • Published 6 months ago
@simple-persist/angular v0.1.0
SimplePersist Angular
SimplePersist decorator to handle Angular forms
Table of Contents
Installation
npm install @simple-persist/angular
Quick start
Add @PersistControl()
decorator to a FormGroup or FormControl class property:
import { PersistControl } from '@simple-persist/angular';
import { FormControl, FormGroup } from '@angular/forms';
class Foo {
@PersistControl() public bar?: FormGroup;
// or
@PersistControl() public baz?: FormControl;
}
Note: All configuration options of
@Persist()
from @simple-persist/core are available for@PersistControl()
as well. Use the same syntax to define custom keygens, middlewares or storage for your decorator!
Read more
For more information (caveats, advanced use, other extensions) see @simple-persist/core.
Check out my article about the reasoning behind this package: Do we need state management in Angular?
Collaboration
Feel free to suggest features, open issues, or contribute! Also let me know about your extensions, so I can link them in this document.