Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71529

ngFor Not Updating

$
0
0

@finke wrote:

Hi,

I am building an app with version 2.0.0-beta.4 and I am running into the following problem:

I have got an ngFor bound to an array.
<ion-item *ngFor="#place of places"> {{place.place_id}} </ion-item>

With a button, I call the onGetNear() function:
<button (click)="onGetNear()">Near</button>

onGetNear() {
 let req = { ... };

 this._dataService.nearbySearch(req).subscribe(res => {
   this.places = res;
   console.log(this.places);
 });
}

Now, the thing is that my console logs the response correctly on every button press, but the DOM isn't updating. Once I click another button or open the sidemenu, ngFor displays all items correctly.

Any ideas where this behavior comes from?

Posts: 8

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 71529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>