Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Override Back Buton

$
0
0

Hi All,

I creaded an application and I want to override the backbutton.
This code works but it is not actived when user start application.
User needs press "burger menu" one time to active the following code.
Can i have help, please ?

.run(function($ionicPlatform,$rootScope,$ionicSideMenuDelegate, $state, $window) {

      // Disable BACK button on home

      //alert('registerBackButtonAction !!!');
      $ionicPlatform.registerBackButtonAction(function (event) {
          //alert($state.current.name);
          event.preventDefault();
          if(($state.current.name!="app.winesDetail") && ($state.current.name!="app.ficheDetail")){
             $ionicSideMenuDelegate.toggleLeft();
          } else {
           navigator.app.backHistory();
          }
          //event.preventDefault();
          return false;
      }, 101);

      //$ionicSideMenuDelegate.toggleLeft();
      //$ionicSideMenuDelegate.toggleLeft();
      //angular.element('#menuBouton').trigger('click');

    });
})

Viewing all articles
Browse latest Browse all 228595

Trending Articles



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