I am trying to extract the content from the <content>
element within my custom element named as shown below
<my-element>Important text</my-element>
My query is: How can I retrieve this text inside my polymer element?
This is how my polymer element currently appears:
<polymer-element name="my-element">
<template>
<template if="{{show}}">
<content id="content"></content>
</template>
</template>
<script>
Polymer('my-element', {
ready: function () {
this.show = true;
//var text = this.$.content.getDistributedNodes(); // doesn't work
}
});
</script>
</polymer-element>
Any insights on how I can accomplish this task efficiently?