import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'app-loc-tiles',
  templateUrl: './loc-tiles.component.html',
  styleUrls: ['./loc-tiles.component.scss']
})
export class LocTilesComponent implements OnInit {
  @Input() locDets: any;
  otIcons: boolean = false;
  deleteData: any;
  @Output() locDeleteEvent = new EventEmitter();
  @Output() locEditEvent = new EventEmitter();

  constructor() { }

  ngOnInit() {
    console.log(this.locDets);
  }
  showLocOtherIcons(){
    this.otIcons = true;
  }
  deleteLocation(id, loc){
    console.log("to del -- "+id);
    console.log(id);
    this.deleteData = {}
    this.deleteData.id = id;
    this.deleteData.isDelete = true;
    console.log(this.deleteData);
    this.locDeleteEvent.emit(this.deleteData);
  }
  editLocation(id, loc){
    console.log("to edit -- "+id);
    this.locEditEvent.emit(loc);
  }
}
