Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="container">
- <div class="content">
- <div class="todo-table">
- <table>
- <tbody>
- <tr *ngFor="let todo of todoList" class="todo-row" [ngClass]="{'checked': todo.isCompleted}" (click)="todo.isCompleted = !todo.isCompleted">
- <td class="todo-col">{{todo.iter+1}}</td>
- <td class="todo-col">{{todo.title}}</td>
- <td class="todo-col">{{todo.text}}</td>
- <td class="todo-col btn" (click)="deleteTodo(todo.iter)">Delete</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="todo-create">
- <form (submit)="addTodo($event)">
- <input [(ngModel)]="newTodo.title" (keyup.enter)="newTodo.title=''" class="textfield" name="newTodo-title" />
- <input [(ngModel)]="newTodo.text" (keyup.enter)="newTodo.text=''" class="textfield" name="newTodo-text" />
- <button class="btn" type="submit" [disabled]="(newTodo.title==='') && (newTodo.text==='')">Add Todo</button>
- </form>
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment