Last active
October 21, 2015 17:47
-
-
Save shrunyan/d9b0bd5ee0ac0b4ce344 to your computer and use it in GitHub Desktop.
Example of riot todo MVC
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
<todo> | |
<h3>TODO</h3> | |
<ul> | |
<li each={ item, i in items }>{ item }</li> | |
</ul> | |
<form onsubmit={ handleSubmit }> | |
<input type="text" /> | |
<button>Add #{ items.length + 1 }</button> | |
</form> | |
this.items = [] | |
handleSubmit(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