I would like to pipe
a form group of a reactive form.
Then I would like to do some checks on this group separate controls.
Here is how I define my form
myForm = this.formBuilder.group({
myFormNameDrop: this.formBuilder.group({
myName:['',Validators.required],
myDrop:['era']
}),
style:[''],
userId:[this.user_id]
});
And this is the pipe
I try to create
this.results = this.myForm.value.myFormNameDrop.valueChanges.pipe(
debounceTime(400),
distinctUntilChanged(),
filter(formdata => formdata.myName.length > 0),
switchMap( formdata => this.shoesService.details(formdata.myName)),
shareReplay(1)
);//pipe
I get two errors.
TypeError: Cannot read property 'pipe' of undefined
about the this.results = this.myForm.value.myFormNameDrop.valueChanges.pipe(
and VS code shows a warning about the filter(formdata => formdata.myName.length > 0),
: Property myName
does not exists on type '{}'
How can I access formGroups and controls of formGroups in such cases? I use angular 6
Thanks