I have a script in my html file as this
<script>
if (window.TamaraProductWidget) {
window.TamaraProductWidget.render();
}
</script>
I did this in my ts class to import the script src
this.myScriptElement = document.createElement("script");
this.myScriptElement.src = "https://.....-widget.min.js";
document.body.appendChild(this.myScriptElement);
How do I call it in my typescript class? Since it's not working, but if I call window.TamaraProductWidget.render();
in console of browser it works well.