From d684bd32d2b1dce27c6c2e1a3270061fdf619021 Mon Sep 17 00:00:00 2001 From: mpuebla Date: Thu, 15 Aug 2019 12:36:05 -0300 Subject: [PATCH] Cambio de tipo en objeto sinonimo. --- .../popover-sinonimos/popover-sinonimos.component.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/components/popover-sinonimos/popover-sinonimos.component.ts b/src/app/components/popover-sinonimos/popover-sinonimos.component.ts index 370f0e6..4f4b09a 100644 --- a/src/app/components/popover-sinonimos/popover-sinonimos.component.ts +++ b/src/app/components/popover-sinonimos/popover-sinonimos.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { PopoverDirective } from 'ngx-bootstrap'; -import { Sinonimo } from 'src/app/wrappers/sinonimo'; +import { Producto } from 'src/app/wrappers/producto'; @Component({ selector: 'app-popover-sinonimos', @@ -11,13 +11,18 @@ 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; + @Input() popoverContent: Producto[]; + @Output() sinonimoSeleccionado = new EventEmitter(); + sinonimo: Producto; constructor() { } ngOnInit() { + + //Seteo en la variable a emitir el sinonimo que sea padre + this.popoverContent.forEach(sinonimo => { + this.sinonimo = sinonimo.esPadre ? sinonimo : undefined; + }) } hidePopover() { @@ -26,7 +31,7 @@ export class PopoverSinonimosComponent implements OnInit { this.popover.hide(); } - setSinonimo(sinonimo: Sinonimo) { + setSinonimo(sinonimo: Producto) { this.sinonimo = sinonimo; } -- 1.9.1