Last active
August 29, 2015 14:14
-
-
Save mikeptweet/861f54ec5c8514a96dbd to your computer and use it in GitHub Desktop.
designer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link rel="import" href="../polymer/polymer.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| This is <b>{{owner}}</b>'s age-slider. | |
| <b>{{name}}</b> lets me borrow it. | |
| He likes the color <span style="color: {{color}}">{{color}}</span>. | |
| I am <b>{{age}}</b> years old. | |
| <p><label for="ageInput">Age:</label> | |
| <input id="ageInput" type="range" | |
| value="{{age}}"> | |
| <label for="nameInput">Name:</label> | |
| <input id="nameInput" value="{{name}}" | |
| placeholder="Enter name..."></p> | |
| </template> | |
| <script> | |
| Polymer({ | |
| age: 25, | |
| name: "Daniel", | |
| color: "red", | |
| owner: "Eric", | |
| nameChanged: function() { | |
| if (this.name) { | |
| // Ensure name is capitalized | |
| this.name = this.name[0].toUpperCase() + | |
| this.name.slice(1); | |
| } | |
| } | |
| }); | |
| </script> | |
| </polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment