1 import { Input, Component, Output, EventEmitter, OnInit, ChangeDetectionStrategy, OnChanges } from '@angular/core'
2 import { RouterLink } from '@angular/router'
3 import { ListKeyManagerOption } from '@angular/cdk/a11y'
5 export type SuggestionPayload = {
7 type: SuggestionPayloadType
8 routerLink?: RouterLink
12 export type SuggestionPayloadType = 'search-instance' | 'search-index'
15 selector: 'my-suggestion',
16 templateUrl: './suggestion.component.html',
17 styleUrls: [ './suggestion.component.scss' ]
19 export class SuggestionComponent implements OnInit, ListKeyManagerOption {
20 @Input() result: SuggestionPayload
21 @Input() highlight: string
27 return this.result.text
31 if (this.result.default) this.active = true