Last active
August 29, 2015 14:14
-
-
Save lukehoban/dd315f330670e16eca68 to your computer and use it in GitHub Desktop.
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
var client = new WindowsAzure.MobileServiceClient( | |
"https://lukeh-todo-fri.azure-mobile.net/", | |
"qKxbOVPoAoQovsrxCKmEWhzTOrCZpL60" | |
); | |
function update() { | |
$("#todoBody").empty() | |
client.getTable("Todo").read().then(function (res) { | |
res.forEach(function (item) { | |
$("#todoBody").append($("<tr><td>" + item.text + "</td></tr>")) | |
}); | |
}); | |
} | |
$("#addTodo").click(function () { | |
var item = { text: $("#newTodo").val() }; | |
client.getTable("Todo").insert(item).then(update) | |
}) | |
update(); |
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
<h1>Todo List</h1> | |
<form class="form-inline"> | |
<input type="text" class="form-control" placeholder="Add a new todo..." /> | |
<btn typeof="submit" class="btn btn-primary">Add Todo</btn> | |
</form> | |
<br/> | |
<table class="table table-bordered"> | |
<thead><tr><th>Topic</th></tr></thead> | |
<tbody> | |
<tr><td>Finish this section</td></tr> | |
<tr><td>Talk about Azure!</td></tr> | |
</tbody> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment