1 import { Input, Component, Output, EventEmitter, OnInit, ChangeDetectionStrategy } from '@angular/core'
2 import { RouterLink } from '@angular/router'
3 import { ListKeyManagerOption } from '@angular/cdk/a11y'
7 type: 'channel' | 'suggestion' | 'search-channel' | 'search-instance' | 'search-global' | 'search-any'
8 routerLink?: RouterLink,
13 selector: 'my-suggestion',
14 templateUrl: './suggestion.component.html',
15 styleUrls: [ './suggestion.component.scss' ],
16 changeDetection: ChangeDetectionStrategy.OnPush
18 export class SuggestionComponent implements OnInit, ListKeyManagerOption {
19 @Input() result: Result
20 @Input() highlight: string
21 @Output() selected = new EventEmitter()
27 return this.result.text
31 if (this.result.default) this.active = true
35 this.selected.emit(this.result)