How to load external scripts dynamically in Angular?

Posted by Jessica Taylor | Updated on

If you want to load external scripts dynamically in Angular? If you’re using system.js, you can use System.import() at runtime:

If you’re using webpack, you can take full advantage of its robust code splitting support with require.ensure:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers