'Dynamically Update Web Component Script Tag
I'm currently using Angular elements to generate web components for a project and I'm having issues figuring out a way to dynamically change the script version value in a way to still work with the web component. I'm somewhat new to web components so any help is appreciated. An example of what is put in the HTML..
<webcomponent-classroom></webcomponent-classroom>
<script src="http://192.168.1.123:8080/webcomponent-classroom.js?v=13"></script>
I've tried things like this for example with no luck
<script>document.write('http://192.168.1.123:8080/webcomponent-classroom.js?v=' + Date.now() + '"><\/script>');</script>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|