Last active
November 9, 2020 10:50
-
-
Save nivrith/493e3e421732c57ff384835b17f29b6d to your computer and use it in GitHub Desktop.
Truly Reactive Forms in Angular - Observable of FormArray
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class AppComponent{ | |
| form: Observable<FormArray>; | |
| constructor(private fb: FormBuilder) {} | |
| ngOnInit() { | |
| this.formArray$ = this.posts$.pipe( | |
| map(posts => this.fb.array(posts.map(post => this.fb.group(post)))) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment