Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit, Input } from '@angular/core';
- @Component({
- selector: 'app-actions',
- templateUrl: './actions.component.html',
- styleUrls: ['./actions.component.css']
- })
- export class ActionsComponent implements OnInit {
- @Input()
- public locationList;
- @Input()
- public selected;
- ngOnInit() {
- }
- onClickDelete() {
- this.selected.forEach(selectedItem => {
- this.locationList.forEach(listedItem => {
- if (selectedItem._element.nativeElement.children[0].textContent.trim() === listedItem.trim()) {
- this.locationList.splice(this.locationList.indexOf(listedItem),1);
- }
- });
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement