Skip to Content

get Method

Retrieves the current value of the form control, form group, or form array

@returns T
The form data

API

get(): T;

Example

import {FormControl, FormGroup} from '@angular/forms'; import {formSource} from '@bitfiber/ng/rx'; interface FormValue { itemId: number; search: string; } // Creates a form group const formGroup = new FormGroup({ itemId: new FormControl(1, {nonNullable: true}), search: new FormControl('', {nonNullable: true}), }); // Creates a form source const source = formSource<FormValue>(formGroup); // Returns the form value const value = source.get();
Last updated on