Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Cordova plugins not working inside .config() in iOS

$
0
0

@iamsim wrote:

Calling cordova network plugin inside interceptor which is inside the config( function(){} ) is failing and it says - "undefined is not an object" for window.plugin.network.type

device - iPad

$httpProvider.interceptors.push(function($rootScope, $cordovaNetwork) {
return {
request: function(config) {
if ($cordovaNetwork.isOnline()) {
$rootScope.$broadcast('loading:show');
return config;
}
},
response: function(response) {
$rootScope.$broadcast('loading:hide');
return response;
},
responseError: function(rejection) {
$rootScope.$broadcast('loading:hide');
return rejection;
}
}
})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



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