Some of my routes require functionality from external JS. I donβt want to download them all at once, since these JSs are needed only on certain routes (for example, /upload needs some JS for uploading photos, /photos needs another JS for lightboxes, /funny needs JS for animation, etc.) .
What is the best practice for lazily loading these external Java scripts?
These routes can be accessed several times (for example, the user can go to /upload , then /photos , then /upload again)
angularjs
wiradikusuma
source share