I would like to make a "user profile" page. It should load all of the data of the registered user to input fields (if the data exists). Then everyone can edit these (or add new ones). The first step would be to load the data to the specific input fields. I sucessfully make a GET request (everything is good in the console), but the input fields remain empty.
The component:
getData() {
this.apiService.getUser(this.id, this.email, this.password).subscribe(
(user) => {
this.user = user;
this.bankArray.push(user.banks);
},
);
}
HTML:
<form>
<h3>Name</h3>
<div *ngFor="let obj of user.personal">
<input
type="text"
placeholder="Title"
name="title"
[(ngModel)]="obj.title"
/>
<br />
<input
type="text"
placeholder="Forename"
name="foreName"
[(ngModel)]="obj.foreName"
/><br />
</div>
<h3>Financial</h3>
<button (click)="addNewBank()">+</button>
<div *ngFor="let obj of bankArray; let i = index">
<button (click)="removeBank(i)">-</button>
<br />
<input
type="text"
placeholder="Bank name"
name="bankName{{ i }}"
[(ngModel)]="obj.bankName"
/><br />
<input
type="number"
placeholder="IBAN"
name="iban{{ i }}"
[(ngModel)]="obj.iban"
/><br />
</form>

