I am facing an issue with my FormGroup in my form where it is not recognizing the standard values coming from my web api. It sets all the values to null unless I manually type something into the input field. This means that if I try to update a user, it ends up resetting the entire user.
Here is my Form:
<form [formGroup]="persoForm" (ngSubmit)="onSubmit()">
<div id="firma">
<mat-form-field appearance="standard" id="firm" floatLabel="always">
<mat-label> Firmenbez.:</mat-label>
<input matInput type="text" name="firm" formControlName="firmenBez" [value]="person.firmenbezeichnung"/>
</mat-form-field>
</div>
</form>
TS
persoForm = new FormGroup({
firmenBez: new FormControl(),
})
Checking for null values:
onSubmit() { //currently only there to check if the values are still null
console.log(this.persoForm.getRawValue());
}