Hello, I do fields for editing an object in angular, I ran into a problem when fields already transferred in value are not processed when forms are submited, more precisely they are processed only when you edit them, here’s an example of how to deal with this
<form [formGroup]="myForm" (ngSubmit)="onSubmit(myForm)"> <input formControlName="title" type="text" class="form-control" placeholder="Название" value="{{ content?.title }}"/> <input formControlName="body" type="text" class="form-control" placeholder="Контент" value="{{ content?.body }}"/> <input type="submit" value="Редактировать"/> </form>
this.myForm.get('title').setValue = yourAsyncValuein your instance-classthis.myForm.get('title').setValue = yourAsyncValue