how to get formcontrol value in reactive form code example
Example 1: reactive forms get value of control
/*-----Angular reactive forms-----*/
// declare a form with properties i.e. name
this.form = this.formBuilder.group({
name: ['', Validators.required]
});
// Get value
this.form.get('name').value
Example 2: get formcontrol value
this.loginForm = new FormGroup({
'email': new FormControl('', { validators: [Validators.required] })
});
// get like this
const { email } = this.loginForm.value;