Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49284

Ionic 3: How make ionViewWillEnter only when back button pressed?

$
0
0

@thamaraiselvam wrote:

I have read Navigating Lifecycle Events

My use case here is. I had to refresh the content on page load as well as when back button pressed from another page.

ionViewDidLoad(){
   this.getProjects();
}

ionViewWillEnter(){
   this.getProjects();
}

this works fine but of course ionViewWillEnter runs on first page load as well. so two api requests triggered (ionViewDidLoad + ionViewWillEnter). Is there any way to restrict them like setting flag or something?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49284

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>