cordovaNetwork clear history, ion-nav-title and menu-toggle


#1

I renew the application when the network status changes and I show local data.But disappear ion-nav-title and menu-toggle and delete history.How do I fix it.

   document.addEventListener("deviceready", function () {
    $rootScope.$on('$cordovaNetwork:online', function(event, networkState){
      console.log(networkState);
      $state.go($state.current, {}, {reload: true});
      if(!$scope.$$phase) {
        $scope.$apply();
      }
    });
    $rootScope.$on('$cordovaNetwork:offline', function(event, networkState){
      console.log(networkState);
      $state.go($state.current, {}, {reload: true});
      if(!$scope.$$phase) {
        $scope.$apply();
      }
    });
  }, false);


#2

Hi, i have exactly the same issue.

.run(function($ionicPlatform, $cordovaNetwork, $rootScope) {
 
 
 $ionicPlatform.ready(function() {
                      
                      if (window.Connection) {
                      $rootScope.$on('$cordovaNetwork:online', function(event, networkState) {
                                     alert('online');
                                    
                                     })
                      $rootScope.$on('$cordovaNetwork:offline', function(event, networkState) {
                                     alert('offline');
                                     })
                      }
                      
                      // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
                      // for form inputs)
                      if (window.cordova && window.cordova.plugins.Keyboard) {
                      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(
                                                                        true);
                      cordova.plugins.Keyboard.disableScroll(true);
                      }
                      if (window.StatusBar) {
                      // org.apache.cordova.statusbar required
                      StatusBar.styleDefault();
                      }
                      });
 })

I looked into the plugin and i don’t know where it says to reload autmaticaly the view and clear the history.
Did you find any tricks or solutions ?