Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Cordova plugins not working inside .config() in iOS

$
0
0

Also in a .config()

But I don't use a plugin like $cordova network in the http intercept

But I was thinking .. why don't you just skip the online check in your http intercept. so like

$httpProvider.interceptors.push(function($rootScope) {
            return {
                request: function(config) {

                        $rootScope.$broadcast('loading:show');
                        return config;

                },
                response: function(response) {
                    $rootScope.$broadcast('loading:hide');
                    return response;
                },
                responseError: function(rejection) {
                    $rootScope.$broadcast('loading:hide');
                    return rejection;
                }
            }
        })

So it always try and make the intercept and show the loading and if something goes wrong (for instance no network) it always close the loading.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



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