diff --git a/src/app/components/popover-sinonimos/popover-sinonimos.component.ts b/src/app/components/popover-sinonimos/popover-sinonimos.component.ts index 40b291d..370f0e6 100644 --- a/src/app/components/popover-sinonimos/popover-sinonimos.component.ts +++ b/src/app/components/popover-sinonimos/popover-sinonimos.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { PopoverDirective } from 'ngx-bootstrap'; import { Sinonimo } from 'src/app/wrappers/sinonimo'; @@ -12,7 +12,8 @@ export class PopoverSinonimosComponent implements OnInit { //Directiva del popover, para poder cerrarlo desde este componente @Input() popover: PopoverDirective; @Input() popoverContent: Sinonimo[]; - sinonimoAelegir: Sinonimo; + @Output() sinonimoSeleccionado = new EventEmitter(); + sinonimo: Sinonimo; constructor() { } @@ -21,12 +22,13 @@ export class PopoverSinonimosComponent implements OnInit { hidePopover() { + this.sinonimoSeleccionado.emit(this.sinonimo); this.popover.hide(); } setSinonimo(sinonimo: Sinonimo) { - this.sinonimoAelegir = sinonimo; + this.sinonimo = sinonimo; } }