Динамически созданный импорт html внутри полимерного элемента
Кто-нибудь знает, как динамически добавить импорт html в полимерный элемент (версия 1.0)?
Код ниже не работает и жалуется, что... HTML element <link> is ignored in shadow tree.
Кто-нибудь знает какой-нибудь способ обойти это или знает лучший способ?
<!-- here is where the created import could go -->
<dom-module id="my-component">
<!-- here is where I'd ideally like the import to be created -->
<template>
<div id="container">
<!--This is where my dynamically loaded element should be placed-->
</div>
</template>
<script>
Polymer({is:'my-component',
attached: function(){
var importElem = document.createElement('link');
importElem.rel = 'import';
importElem.href = '/components/my-dynamic-sub-component.html';
this.root.appendChild(importElem);
var app = document.createElement('my-dynamic-sub-component');
this.$.container.appendChild(app);
}
});
</script>
</dom-module>