Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a single value from FormGroup

I am aware that I can get the values of a form using

JSON.stringify(this.formName.value) 

However, I want to get a single value from the form.

How do I go about doing that?

like image 537
Stephen Romero Avatar asked May 01 '17 02:05

Stephen Romero


People also ask

How do I get data from FormControl?

Get and Set Value To fetch the value of a form control, we have to use value property on the instance of FormControl in our class. In the same way we can fetch the value in HTML template. city = new FormControl('Noida'); console.


1 Answers

You can get value like this

this.form.controls['your form control name'].value 
like image 131
RemyaJ Avatar answered Sep 30 '22 18:09

RemyaJ