I have angular.js application in which I would like to initialize a web component.
It works perfectly fine on other browsers but it seems that IE11 has issues with
document.importNode
angular.js onInit function:
vm.$onInit = function() {
vm.params = $location.search();
if(vm.params.merchantId && vm.params.apiToken && vm.params.amount && vm.params.orderId) {
vm.mid = vm.params.merchantId;
vm.apiToken = vm.params.apiToken;
vm.amount = vm.params.amount;
vm.orderId = vm.params.orderId;
let template = document.querySelector('#template');
let clone = document.importNode(template.content, true);
let cmp = clone.querySelector('cmp-request');
cmp.setAttribute('mid', vm.mid);
template.replaceWith(clone);
}
}
HTML:
<template id="template">
<cmp-request></cmp-request>
</template>
Is there any other way to clone web component and pass params inside without using importNode so it would work on IE11?