In my HTML I am binding an item in a repeat:
<ul *ngFor="let item in items">
<li>{{ item.id }}</li>
</ul>
This is working fine. But now that value is being changed in an API call, like so:
doApiCall(){
let value = this.items.find( x => x.id = '123');
this.service.doIt().subscribe(
(res: HttpResponse<myModel>) => {
// response === { id = 456' }
return value = res.body;
}
)
}
now the item in the array has changed, but the view does not change. But the funny thing is, if I change the let value manually right after it is set, like so:
let value = this.items.find( x => x.id = '123');
value.id = '345'
then the update happens. So I do not know If I am doing something wrong in the API call.
{{ item.id }}is a 1-way binding. 2-way bindings are used with[(ngModel)]<input>?