@ihadeed wrote:
Hello,
I'm building an app using Ionic 2 alpha 53, Angular 2, Typescript..
What I have is similar to the example below:
HTML
<ion-item *ngFor="#item in items">
...
</ion-item>TypeScript
export class MyPage {
constructor() {
this.items = []; // Create a blank array to avoid start-up errors
MyProvider.getItems().then( items => {
this.items = items; // Update items
});
}
}After the page is loaded and it successfully retrieved the items from my provider, it does not update the DOM. I would have to manually click on something such as an Action Sheet or a Side Menu to refresh the DOM and display the updated items.
Not sure why I'm having this issue... I looked at the sample Ionic Conference App and it seems like they're doing it exactly the same way.
...
Any thoughts?
EDIT: It seems like this issue only occurs when I try to replace the whole array. If I .push() or .splice() it updates fine. But again, Ionic Conference App is replacing the whole array and it works fine!
Posts: 9
Participants: 3