I am building a polymer element hosting frame, where the user can configure what item they want to be hosted inside the outerframe with header. For instance if the content is set to 'paper-button' the host will display the button with toolbar. Where do I add the appendChild code, it doesn't work on ready or attached event?
<dom-module id="element-host">
<template>
<paper-header-panel>
<paper-toolbar>Header</paper-toolbar>
<content id="content"></content>
</paper-header-panel>
</template>
<script>
Polymer({
is: 'element-host',
properties: {
content : {
type: string
}
},
attached: function(renderer) {
var customElement = document.createElement(this.content);
this.$.content.appendChild(customElement);
}
});
</script>
</dom-module>
ready, before your element is attached to native DOM. - Dmytro