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