urish / angular-load

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

Remove scripts from DOM #3

Open zlalanne opened 9 years ago

zlalanne commented 9 years ago

Would be nice to be able to remove scripts from the DOM once the page/url changes. This way the DOM doesn't end up with a ton of script tags. Don't think this is a huge performance concern, just a nice feature.

urish commented 9 years ago

Would be nice indeed. Is there any proposed way to achieve this automatically?

zlalanne commented 9 years ago

Maybe keep track of the elements in an array as their loaded and on a route change remove from DOM. Haven't tried it yet though.

vaneshmali commented 8 years ago

@zlalanne : Same, I want. Using Requirejs with AngularAMD. Want to remove script from DOM. If is there any solution for this then it will be better for me!

soumak77 commented 8 years ago

I've been using this solution and it seems to work perfectly: http://stackoverflow.com/a/9425964