From 2b3acb1761330983e4540e8197e9124fdcbe40e2 Mon Sep 17 00:00:00 2001 From: mpuebla Date: Thu, 15 Aug 2019 11:13:32 -0300 Subject: [PATCH] Agregado emitter para pasar el sinonimo seleccionado. --- .../components/popover-sinonimos/popover-sinonimos.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } } -- 1.9.1