Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2 from sjmiles/sample-tweaks
Browse files Browse the repository at this point in the history
use nameChanged not keyup for input value, format for wrapping
  • Loading branch information
Scott J. Miles committed Apr 15, 2013
2 parents 04b308e + a268049 commit bf690df
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions samples/components/tk-binding-to-elements.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
<element name="tk-binding-to-elements">
<template>
<p>This is <strong>{{owner}}</strong>'s tk-element but <strong>{{name}}</strong> lets me borrow it. He likes the color <span style="color: {{color}}">{{color}}</span>. I am <strong>{{age}}</strong> years old.</p>
<p>This is <strong>{{owner}}</strong>'s tk-element but
<strong>{{name}}</strong> lets me borrow it.
He likes the color <span style="color: {{color}}">{{color}}</span>.
I am <strong>{{age}}</strong> 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}}" on-keyup="processName" placeholder="Your name here...">
<input id="nameInput" value="{{name}}" placeholder="Your name here...">
</template>
<script>
Toolkit.register(this, {
ready: function() {
// Ready to go.
},
age: "25",
name: "Daniel",
color: "red",
owner: "Eric",
processName: function(e) {
// Do something.
},
nameChanged: function() {
if (this.name) {
// ensure capitilization
this.name = this.name[0].toUpperCase() + this.name.slice(1);
}
}
});
</script>
</element>
</element>

0 comments on commit bf690df

Please sign in to comment.