Page does not load elements when updating to Ionic 2

Asked

Viewed 258 times

1

Well I have an app with side menu where the first page is the home, and it loads elements as soon as the user enters the app. I’m using Ionic 2 and 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 return the elements load, someone can 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 wait answer, and I can help with other questions. :)

1 answer

0

The solution for this milestones, is to use the Ngzone, follows image. If the doubt remains, can contact via Whats: +55 88 9 97295604

Follow code in image

enter image description here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.