Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import { Component, OnInit, Input } from '@angular/core';
  2.  
  3. @Component({
  4. selector: 'app-actions',
  5. templateUrl: './actions.component.html',
  6. styleUrls: ['./actions.component.css']
  7. })
  8. export class ActionsComponent implements OnInit {
  9.  
  10. @Input()
  11. public locationList;
  12.  
  13. @Input()
  14. public selected;
  15.  
  16. ngOnInit() {
  17. }
  18.  
  19. onClickDelete() {
  20. this.selected.forEach(selectedItem => {
  21.  
  22. this.locationList.forEach(listedItem => {
  23.  
  24. if (selectedItem._element.nativeElement.children[0].textContent.trim() === listedItem.trim()) {
  25. this.locationList.splice(this.locationList.indexOf(listedItem),1);
  26. }
  27. });
  28.  
  29. });
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement