ngx-typed-forms
Provides wrapped Angular's FormBuilder to write AbstractControl<T>
.
It's a workaround for issue#13721.
Install
yarn add ngx-typed-forms
or
npm install ngx-typed-forms
Remarks
This module requires TypeScript v2.3.2 or later because using Generics defaults feature.
Usage
First, import module into your app:
;
And you can build some form group with FormBuilder
provided by this module. For example:
// import { FormBuilder } from '@angular/forms';; ngOnInit }
Or more complex example:
; ; ; // returns AbstractControl<{ first: string; last: string; }>nameCtrl.valueChanges.subscribeconsole.loglast, first;
License
This software is released under the MIT License, see LICENSE under the this repository.