check for internet connection if it’s working or not
if (navigator.network.connection.type == Connection.NONE) {
$ionicPopup.show({
title: '<h1 class="delete_popup">No Internet Connection !<br>',
template: '<h2 class="ceter_popup_text">You have no Internet Connection</h2>',
cssClass: 'custom-popup',
buttons: [{
text: 'Try Again',
onTap: function (e) {
}
}, {
text: 'Cancel',
onTap: function (e) {
ionic.Platform.exitApp();
}
}]
});