Page does not load elements when updating in Ionic 2

1

Well I have a side menu app where the first page is home, and it loads elements as soon as the user enters the app. I'm using Ionic 2 and the communication is being done via socket. One detail is that the elements do not load when I update, but when I click the menu button and I get back the elements load, can anyone help me?

follows component code:

export class HomePage{

  item: Array<{title: string, owner: string}>;
  eventsList: Event[]

  constructor(public navCtrl: NavController, 
              public eventService: EventService,
              public platform: Platform) {
  }

  ionViewDidLoad() {
    console.info('HomePage initializated');
    this.platform.ready().then( () => {

      this.eventService.getAllEvents().subscribe(
        events => {
          this.eventsList = events
          console.log(events)
        }, err => {
          console.log("ERROR!", err)
        }
      ) 

    })

  } 
}

I'm waiting for an answer, and I can help with other questions. :)

    
asked by anonymous 19.01.2017 / 01:08

1 answer

0

The solution to this milestones, is to use NgZone, follow image. If the doubt remains, you can contact via whats: +55 88 9 97295604

Follow the code in the image

    
16.04.2017 / 03:18