angular-http-loader
angular-http-loader copied to clipboard
Add the ability to disable http loader for certain urls on a white listed domain
It would be good to have the ability to stop http loader from showing for certain urls on a whitelisted domain.
This request was originally part of https://github.com/wongatech/angular-http-loader/issues/21
You can check my fork i have implemented blacklistDomain
thing for myself you too can use.
Cheers!
https://github.com/corientdev/angular-http-loader
@corientdev how to implement your code for blacklisting URL ?? Actually, I don't want to show the loader when I am making asyc request for autocomplete textbox. I tried implementing your blacklisting changes but it does not seem to be working for me. Thanks
@mgadirocks can you show me your sample code? It should work fine..
@corientdev I made a little tweak to your code. In function isUrlOnWhitelist I placed the
for (var j = blackdomains.length; j--;) {
if (url.indexOf(blackdomains[j]) !== -1) {
return false;
}
}
Above
if (url.substring(0, 2) !== '//' && url.indexOf('://') === -1 && whitelistLocalRequests) {
return true;
}
And it worked for me!
Why I did that because. First I want to check blacklisted URLs array which I am listing in my config function of my app.js. then it should fall to check the whitelistLocalRequests.
Indeed your code helped me @corientdev
Many Thanks.
Cheers!