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. :)