Commit 2b3acb1761330983e4540e8197e9124fdcbe40e2
1 parent
9be01bb197
Exists in
master
and in
1 other branch
Agregado emitter para pasar el sinonimo seleccionado.
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
src/app/components/popover-sinonimos/popover-sinonimos.component.ts
1 | -import { Component, OnInit, Input } from '@angular/core'; | |
1 | +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; | |
2 | 2 | import { PopoverDirective } from 'ngx-bootstrap'; |
3 | 3 | import { Sinonimo } from 'src/app/wrappers/sinonimo'; |
4 | 4 | |
... | ... | @@ -12,7 +12,8 @@ export class PopoverSinonimosComponent implements OnInit { |
12 | 12 | //Directiva del popover, para poder cerrarlo desde este componente |
13 | 13 | @Input() popover: PopoverDirective; |
14 | 14 | @Input() popoverContent: Sinonimo[]; |
15 | - sinonimoAelegir: Sinonimo; | |
15 | + @Output() sinonimoSeleccionado = new EventEmitter<Sinonimo>(); | |
16 | + sinonimo: Sinonimo; | |
16 | 17 | |
17 | 18 | constructor() { } |
18 | 19 | |
... | ... | @@ -21,12 +22,13 @@ export class PopoverSinonimosComponent implements OnInit { |
21 | 22 | |
22 | 23 | hidePopover() { |
23 | 24 | |
25 | + this.sinonimoSeleccionado.emit(this.sinonimo); | |
24 | 26 | this.popover.hide(); |
25 | 27 | } |
26 | 28 | |
27 | 29 | setSinonimo(sinonimo: Sinonimo) { |
28 | 30 | |
29 | - this.sinonimoAelegir = sinonimo; | |
31 | + this.sinonimo = sinonimo; | |
30 | 32 | } |
31 | 33 | |
32 | 34 | } |