P
P
Pogran2017-01-09 12:49:53
Angular
Pogran, 2017-01-09 12:49:53

How to get second level value of group form?

i have a form

targetingForm: FormGroup;

// в конструкторе
 this.targetingForm = fb.group({
            geo: fb.group({
                countries: [false]
            }),
        });

Then I want to get the value in countries code
if(this.targetingForm.controls['geo'].controls['cities'].value) {

        }

The problem is that TypeScript prntscr.com/dtb96t highlights for me . how to get rid of this or write this record in another way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pogran, 2017-01-09
@Pogran

This is how it will be right
this.targetingForm.controls['geo'].value.countries

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question