popover-sinonimos.component.ts 852 Bytes
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { PopoverDirective } from 'ngx-bootstrap';
import { Sinonimo } from 'src/app/wrappers/sinonimo';

@Component({
  selector: 'app-popover-sinonimos',
  templateUrl: './popover-sinonimos.component.html',
  styleUrls: ['./popover-sinonimos.component.scss']
})
export class PopoverSinonimosComponent implements OnInit {

  //Directiva del popover, para poder cerrarlo desde este componente
  @Input() popover: PopoverDirective;
  @Input() popoverContent: Sinonimo[];
  @Output() sinonimoSeleccionado = new EventEmitter<Sinonimo>();
  sinonimo: Sinonimo;

  constructor() { }

  ngOnInit() {
  }

  hidePopover() {

    this.sinonimoSeleccionado.emit(this.sinonimo);
    this.popover.hide();
  }

  setSinonimo(sinonimo: Sinonimo) {

    this.sinonimo = sinonimo;
  }

}