Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nivrith/493e3e421732c57ff384835b17f29b6d to your computer and use it in GitHub Desktop.

Select an option

Save nivrith/493e3e421732c57ff384835b17f29b6d to your computer and use it in GitHub Desktop.
Truly Reactive Forms in Angular - Observable of FormArray
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