Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Go to slide 0 if active slide is more then 0 else exitApp in Ionic-v3

$
0
0

@gokujy wrote:

I am using ionic slides and i want exit app if active slide is zero else active slide is more then zero to go to on zero any idea what to do…please help.

constructor(platform: Platform, public navCtrl: NavController, public navParams: NavParams, private superTabsCtrl: SuperTabsController, private popoverCtrl: PopoverController, public storage: Storage) {
    this.rootNavCtrl = this.navParams.get('rootNavCtrl');
    platform.ready().then(() => {
      platform.registerBackButtonAction(() => {
       if (this.currentIndex == 0){
         platform.exitApp();
        //}else if(this.currentIndex > 1 && this.currentIndex > 13) {
          //  this.currentIndex = this.slides.getActiveIndex() - 1;
        }else{
          this.slides.slideTo(0, 500);
        }
      });
    });
  } 

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



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