Custom polymer element doesn't show text

187 views Asked by At

I am using Dart with the Dart Editor to create a custom polymer element. The element is a button and I would like to use it like this:

<my-button>text</my-button>

Just like you would use the button element in HTML5. The text inside the element should be the text displayed on the button. Here is my HTML code:

<link rel="import" href="packages/polymer/polymer.html">
<polymer-element name="my-button">
    <template>

    </template>
    <script type="application/dart" src="my-button.dart"></script>
</polymer-element>

Why isn't the text displayed? Should I use attributes instead?

1

There are 1 answers

0
Reuben Sanders On BEST ANSWER

I figured out the answer while typing the question, but just in case anyone else has the same issue, this did the trick:

<link rel="import" href="packages/polymer/polymer.html">
<polymer-element name="my-button">
    <template>
        <content></content>
    </template>
    <script type="application/dart" src="my-button.dart"></script>
</polymer-element>