I have this module which componentize the external library together with additional logic without adding the tag directly into the index.html:
In my case, I've loaded both the js and css visjs files using the above technique - which works great. I call the new function from ngOnInit()
Note: I could not get it to load by simply adding a and tag to the html template file.
loadVisJsScript() {
console.log('Loading visjs js/css files...');
let script = document.createElement('script');
script.src = "../../assets/vis/vis.min.js";
script.type = 'text/javascript';
script.async = true;
script.charset = 'utf-8';
document.getElementsByTagName('head')[0].appendChild(script);
let link = document.createElement("link");
link.type = "stylesheet";
link.href = "../../assets/vis/vis.min.css";
document.getElementsByTagName('head')[0].appendChild(link);
}