Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .factory("Network", ['errorModule','$state','$ionicPopup',function(errorModule,$state,$ionicPopup) {
- return{
- isOnline : function(throwErr){
- var online = navigator.onLine;
- if(!online&&throwErr){
- // errorModule.throwException(100,"No network connection");
- ionicAlert($ionicPopup,'',"No network connection");
- }
- return online;
- }
- }
- }
- ])
- if(navigator.onLine){
- calldataFetchFunction();
- }else{
- var alertPopup = $ionicPopup.alert({
- template: 'no internet connection',
- buttons: [{
- text:'Ok',
- onTap: function(e) {
- calldataFetchFunction();
- }
- }]
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement