Cache custom component content


#1

Hello,

I am creating a custom component which loads the innerHTML from a remote source. My question is how can i load the content when app loads. Right now, the content loads when the page shows and its a small delay until the text appears. Is there an event i can attach to that component to load the content when the app loads?

Thanks,
Radu


#2

So you could use the onPageWillEnter event to attempt to load data before the view has entered

@Page({
  template: 'Hello World'
})
class HelloWorld {
  onPageWillEnter() {
    console.log("before enter");
  }
}