Динамично създаден 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>