Last active
August 29, 2015 14:04
-
-
Save panw/e79d451e5565557fd94c to your computer and use it in GitHub Desktop.
For Part 5 of the tutorial. Added an input field and add button to give users the functionality to add items to the list.
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
<head> | |
<title>Grocery List</title> | |
</head> | |
<body> | |
<!-- render template name groceryList --> | |
{{> groceryList}} | |
</body> | |
<!-- define template name groceryList --> | |
<template name="groceryList"> | |
<!-- A place for users enter a new item and add it to the list --> | |
<input type="text" id="new-item" name="new-item" placeholder="Add an item..."><input type="submit" id="add-button" value="Add"> | |
<ul> | |
<!-- loop through all entries in the Item Collection --> | |
{{#each items}} | |
<!-- render the current items name --> | |
<li class="list-item" id="{{_id}}"><input type="checkbox" value="{{name}}">{{name}}</li> | |
{{/each}} | |
</ul> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment