I have a problem with formControlName, I want to submit this form, but one input is undefined, like in photo.
in console look my submit:
I used this code:
<form [formGroup]="addProductForm" (ngSubmit)="onAddProduct()" class="col s12" materialize style="text-align:center">
<div class="input-field col s12">
<input formControlName="Quantity" id="Quantity " type="number" class="validate" [(ngModel)]="Quantity">
</div>
<div class="input-field col s12">
<input formControlName="Unit_price" id="Unit_price" type="number" class="validate" [(ngModel)]="Unit_price">
</div>
<div class="input-field col s12">
<div class="c1" style="text-align:left;">
Subtotal:
<input formControlName="Subtotal" id="Subtotal" type="number" class="validate" [(ngModel)]="Subtotal" [value]="Quantity*Unit_price">
</div>
</div>
<br>
<div id="add_contrat_button_container" class="row">
<button id="add_contrat_button" type="submit" class="button button1">
Submit
</button>
</div>
</form>
Please, can you look and ask me what is the problem in this code, In Subtotal set automatic this value [value]="Quantity*Unit_price" but don't submit. Thank you


formControlNameandngModel. Remove one and try again. And in both cases, you don't need to use[value][value]supports string only,[ngValue]supports any type(input)event, not use both form modules.