I'm trying to add \node_modules\sip.js\dist\sip.min.js
, to my html file. I tried to import like import * as SIP from 'sip.js/dist/sip';
in my component.ts but this work only if I call some function from it. But I need my html file to read this sip.min.js
.
Also I tried to download local this files and added in my html file
<script src="js/sip-0.5.0.js"></script>
<script src="js/ua.js"></script>
and added:
public loadScript() {
console.log("preparing to load...");
let node = document.createElement('script');
node.src = this.url;
node.type = "text/javascript";
node.async = true;
node.charset = "utf-8";
document.getElementsByTagName("head")[0].appendChild(node);
}
ngOnInit() {
this.loadAPI = new Promise(resolve => {
console.log("resolving promise...");
this.loadScript();
});
}
But this is not working