urish / angular-load

Dynamically load scripts and css stylesheets in your Angular.JS app
MIT License
243 stars 65 forks source link

Update angular-load.js #37

Closed silvamarcel closed 5 years ago

silvamarcel commented 7 years ago

Hi Uri,

I'm using this lib and found a bug, when I try to load a CDN js file and the internet isn't available, the loader fall "deferred.reject(e);" in the line 28, however if I try to load the same CDN later, never enter in the statement "if (typeof promises[url] === 'undefined')" line 13, so I'm proposing a fix in the line 13, just putting the statement inside the if (typeof promises[url] === 'undefined' || promises[url].$$state.status === 2).

Regards, Marcel

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling e7a04d1abc4f8bcee924c5f2f4ac9c0d5da9cb97 on silvamarcel:patch-1 into f9e40ad8da3d26448c7a1b82e6bda8e7da00be6c on urish:master.

carlosbeperaza commented 5 years ago

Hi urish, I was doing tests with you anguar module, It would be perfect to make an unloadScript, so... in the tests I made a function to facilitate it, it is something simple but in my case it was very util...

this.unLoadScript = function (src) { $('script[src="' + src + '"]').remove(); return true; };