Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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