hope somebody can help me? I'm building a form in my component like this (Version not running):
<div *ngFor="let status of someService.monitoringStatus">
<form name="form" [formGroup]="form" (ngSubmit)="updateStatus(form.value,status.id)">
<input type="text" formControlName="next_status" value="{{status.old_status}}">
</form>
</div>
The problem now is that I can't get {{status.old_status}} in my input as value. But why? If I am using it outside it shows me right.
Edit (my component.ts looks like this):
form = new FormGroup({
next_status: new FormControl('', Validators.required)
})
updateStatus(value,id: any){
this.someService.updateStatus(value,id).toPromise().then((data: any) => { console.log(data)
}).catch((err: HttpErrorResponse) => {
console.error('Fehler:', err.error);
});
}
formelement inside the*ngForloop? You are creating as manyformelements as thestatuscount.