I saw in this post that you can use SystemJS to load external javascript files into my components in Angular 2.
In my index.html :
You can use systemjs to do your external dependency loading.
npm i systemjs --only=dev
npm i @types/systemjs --only=dev
You'll need to update your tsconfig.app.json file (tsconfig.json file for older versions of Angular).
"types": ["systemjs"]
Now you'll be able to import
System.import("your-url").then(response => response.methodCall());
If you have an import map specified
You can instead call this code
System.import("import-name").then(response => responce.methodCall());