Skip to content

Commit

Permalink
check connection window.Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
survivaltravel committed Apr 22, 2016
1 parent 5aace52 commit abefab3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ angular.module('starter.controllers', [])
$scope.login = function() {
//var deferred = $q.defer();



if(window.Connection) {
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();
}
});
}
}

/*
if (window.cordova){
if ($cordovaNetwork.isOffline()){
var alertPopup = $ionicPopup.alert({
Expand All @@ -49,7 +66,7 @@ angular.module('starter.controllers', [])
return;
}
}

*/


var postObject = new Object();
Expand Down

0 comments on commit abefab3

Please sign in to comment.