I have a custom Polymer element <foo>. In its <template> element, how can I access the body of the <foo> element? That is, how do I arrange for:
<foo>
<em>Clem</em>
</foo>
to be transformed into
Hello, <em>Clem</em>
via a <template> that will presumably look something like
<polymer-element name="foo">
<template>
Hello, ???
</template>
</polymer-element>
As ebidel points out in Custom Polymer element <x-strong> that works like the builtin <strong>?, you'll need to create an insertion point with the <content> tag.
I should also point out that your element name needs to contain a dash to meet the spec. So it should be <x-foo> or <my-foo>, not just <foo>.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With