I have a group and subgroup register.
My idGroup is getting a value and I have to enter 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 should send this json:
{
"name": "test", **<- Input que vou mandar no post**
"groupItem": {
"id": 1 **<- id que nao consigo enviar**
}
}