Skip to content

Instantly share code, notes, and snippets.

@PinkyJie
Last active December 31, 2015 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PinkyJie/8023432 to your computer and use it in GitHub Desktop.
Save PinkyJie/8023432 to your computer and use it in GitHub Desktop.
template
<script type="text/template" id="item-template">
<tr>
<td><%- id %></td>
<td><%- name %></td>
<td><%- gender %></td>
<td><%- age %></td>
<td>
<a href="#" title="edit"><i class="icon-edit"></i></a>
<a href="#" title="remove"><i class="icon-remove"></i></a>
</td>
</tr>
</script>
<script type="text/template" id="form-template">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="input-name">Name:</label>
<div class="controls">
<input type="text" id="input-name" name="name" value="<%- name %>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="input-gender">Gender:</label>
<div class="controls">
<label class="radio inline">
<input type="radio" name="gender" value="boy"
<% if(gender === 'boy') {%>checked <% } %> />Boy
</label>
<label class="radio inline">
<input type="radio" name="gender" value="girl"
<% if(gender === 'girl') {%>checked <% } %> />Girl
</label>
</div>
</div>
<div class="control-group">
<lable class="control-label" for="input-age">Age:</lable>
<div class="controls">
<input type="number" name="age" id="input-age" value="<%- age %>" />
</div>
</div>
<div class="text-center">
<button type="submit" class="btn">Save</button>
</div>
</form>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment