danhammond
05/05/2022, 8:11 AMjs
let script = document.createElement("script");
script.type = "module";
script.src = "/backoffice/src/main.ts";
document.getElementsByTagName('head')[0].appendChild(script);
That JS file is correctly loading and injecting the real script tag which is running as a module. Vite says it's connected in the dev tools, so all is looking good there.
I'm now facing an issue that because the JS is loading later due to inserting it like that, AngularJS has already started, so my customisations aren't applied.
I'm wondering if I can put a hack in that will cause AngularJS to wait on starting up until after my loaded script has finished. Any ideas on how I might accomplish that?