0
I have a group and subgroup record.
My idGroup is receiving a value and I have to insert it in the form to go in the post.
@Input() idGrupo: any;
configurarFormulario() {
this.formulario = this.formBuilder.group({
name: [null, Validators.required],
groupItem: this.formBuilder.group({
id: []
})
});
}
salvar() {
this.service.postSubgroup(this.formulario.value);
console.log(this.formulario.value);
// console.log(`O id do grupo é esse: ${this.idGrupo}`);
}
He must send this json:
{
"name": "test", **<- Input que vou mandar no post**
"groupItem": {
"id": 1 **<- id que nao consigo enviar**
}
}
I missed passing on the information about how I wanted the json, but it was a great help the answer.
– Cleriston Lincoln