我需要将attribute.iditemAtribute的值传递给我的复选框,该属性分配给我的formControlName atributo_principal_id,但是,当我选中此复选框时,它在formControl中将其值设置为true,如何获得我的[value]的值? / p>
我尝试过类似的事情:
//Print the value of my formcontrol, when i check the checkbox, the value printed is true/false, i need the id_atributo_principal in this formControl
id item atributo: {{atributos.iditemAtributo}}
//Print of the id_item_atributo that i need in my formControl
id atributo: {{item.value.id_atributo_principal}}
<div class="custom-control custom-checkbox ml-2">
<input formControlName="id_atributo_principal" [value]="atributos.iditemAtributo" type="checkbox" class="custom-control-input" id="atributo_principal{{indexatributo}}">
<label class="custom-control-label" for="atributo_principal{{indexatributo}}">Atributo principal</label>
</div>