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

@Component({
  selector: 'drop-down',
  templateUrl: './drop-down.component.html',
  styleUrls: ['./drop-down.component.scss']
})
export class DropDownComponent {

  @Input() ico = 'drop_down_24';
  @Input() angle = [0,-180];
  @Input() visible = false;
  @Input() target:HTMLElement;

  ngOnChanges(){
    if(this.target) this.target.hidden = !this.visible;
  }

  @Output() toggle =  new EventEmitter<boolean>()

  
  click(){    
    this.visible = !this.visible;
    if(this.target) this.target.hidden = !this.visible;
    this.toggle.emit(this.visible)
  }
}
