I would like to know what I have to do to use the "setControl" and "get" in a reactive form when I have an array inside of another formBuilder group. For instance:
this.formulario = this.formBuilder.group({
title: [this.racPessoa.title, [Validators.required]],
description: [this.racPessoa.description, [Validators.required]],
person: this.formBuilder.group({
idPerson:[this.racPessoa.person.idPerson],
name:[this.racPessoa.person.nome],
personDocument: this.formBuilder.array([])
}),
});
In the case above, if I want to handle with the "title, I can write:
this.formulario.setControl('title', something);
this.formulario.get('title');
But I don't know how to write both sentences above when I want to handle with the "personDocument", which is inside of a person
I've tried to use:
this.formulario.setControl('person.personDocument', something);
this.formulario.get('person.personDocument')
But it doesn't work.