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

.ready method is not working

$
0
0

@manojchauhan wrote:

Hi,
I am new to ionic, and i have killed so many time. Still not getting why ready( ) method is not working. I was working to check the internet connectivity.Please help and thanks in advance. :slight_smile:

code:

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])

.run(function($ionicPlatform,$ionicPopup) {

$ionicPlatform.ready(function() {

if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
  alert("keyboard");
  cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  cordova.plugins.Keyboard.disableScroll(true);

}

if (window.StatusBar) {
  StatusBar.styleDefault();
}

if(window.Connection) {
  alert("Connection Check ");
           if(navigator.connection.type == Connection.NONE) {
               $ionicPopup.confirm({
                   title: "Internet Disconnected",
                   content: "The internet is disconnected on your device."
               })
               .then(function(result) {
                   if(!result) {
                       ionic.Platform.exitApp();
                   }
               });
           }
       }

});
})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



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