Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nivrith/4f70f0a436cfa604daa10ec3f6d82462 to your computer and use it in GitHub Desktop.

Select an option

Save nivrith/4f70f0a436cfa604daa10ec3f6d82462 to your computer and use it in GitHub Desktop.
Truly Reactive Angular Forms - Populating Forms with Async Default Values
...
form$: Observable<FormGroup>;
constructor(private fb: FormBuilder) {}
ngOnInit() {
post$ = this.store.select(postQuery.selectCurrentPost);
form$ = this.post$.pipe(map(post => this.fb.group(post)));
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment