Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created June 17, 2019 14:11
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 gavilanch/25d5f8575d6fb1e9299ce7e077f5c77f to your computer and use it in GitHub Desktop.
Save gavilanch/25d5f8575d6fb1e9299ce7e077f5c77f to your computer and use it in GitHub Desktop.
<table class="table table-striped" *ngIf="todos && todos.length > 0">
<thead>
<tr>
<th>Done</th>
<th>Title</th>
<th>Created Date</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let todo of todos, let index = index">
<td><input type="checkbox" [checked]="todo.done" (change)="checkedDone(index)" /></td>
<td [ngClass]="{'done': todo.done, 'not-done': !todo.done}">{{todo.title}}</td>
<td>{{todo.lastModifiedDate | date}}</td>
<td><button class="btn btn-primary btn-edit" (click)="handleEditClick(todo)">Edit</button>
<button class="btn btn-danger" (click)="handleDeleteClick(todo.id, index)">Delete</button></td>
</tr>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment