I need to migrate jsp page to marionette/backbone/requirejs application. App is working, I just need to add one more page. I have a problem with this fragment of jsp:
<script type="module">
import { Handler, Info } from "https://url/script.js";
var handler = new Handler();
handler.perform(Info, "info").then(document.querySelector("custom-tag").product = someData);
</script>
<div>
<custom-tag></custom-tag>
</div>
I tried to include this in my template.htm file and then render it by using _.template(CustomTemplate)
, but it is not working. Well, template is rendered, but the script in module is never called and custom-tag is not filled with data.
Could you give me a hint why it is not working and how to handle such case? I'm not really experienced in frontend.