Executing only one method, without loading the entire controller for the second time

Hi All,

I’m trying to figure out a way to get some data (via a back end api) without loading the entire controller. Let me explain in … :smile:

At bottom of my home page, I have ionic-tabs and it has a notification tab. What I want to do it, when user navigates to another page and return back to the home page, I want to send a request to the backend api and check for new notifications, without loading the whole controller again.

If I user the <ion-view></ion-view> it will load the controller/methods only for the first time, but If I use remove cache <ion-view cache-view="false"></ion-view>, it loads the whole controller again.

So how can I executing only one method, without loading the entire controller for the second time

Thanks in advance

cheers,

Sam

I think what you are looking for is $ionicView.enter.

This event will fire, whether it was the first load or a cached view.

2 Likes

@joseadrian, thanks a lot, I’ll try that, and that seems to be the exact option I’m looking for.

Thanks again