Skip to content

Instantly share code, notes, and snippets.

@khellang
Last active August 29, 2015 14:14
Show Gist options
  • Save khellang/9885845cd6bcf8372314 to your computer and use it in GitHub Desktop.
Save khellang/9885845cd6bcf8372314 to your computer and use it in GitHub Desktop.
<todo>
<!-- layout -->
<h3>{ opts.title }</h3>
<ul>
<li each={ item, i in items }>{ item }</li>
</ul>
<form onsubmit={ add }>
<input>
<button>Add #{ items.length + 1 }</button>
</form>
// logic
this.items = []
add(e) {
var input = e.target[0]
this.items.push(input.value)
input.value = ''
}
</todo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment