Guest User

Untitled

a guest
Dec 13th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. remove(item: List) {
  2. this.list = this.listService.remover(this.list, item);
  3. localStorage.setItem('lists', JSON.stringify(this.list));
  4. }
  5.  
  6. remover(listArray: List[], list: List) {
  7. const listArray1 = listArray.filter(item => item.id !== list.id);
  8. return listArray1;
  9. }
  10.  
  11. <div>
  12. <li *ngFor="let item of list">
  13. <!-- {{checkItem(item)}} -->
  14. <div *ngIf="checkItem(item)">
  15. <input type="checkbox" class="stat" (click)="status(item)" [(checked)]="item.status" />
  16. <span class="task">{{item.task}}</span>
  17. <button class="listBtn" (click)="edit(item)">EDIT</button>
  18. <button class="listBtn" (click)="remove(item)">REMOVE</button>
  19. </div>
  20. </li>
  21. </div>
Add Comment
Please, Sign In to add comment