aboutsummaryrefslogtreecommitdiffstats
path: root/src/angular/searchbar/search-bar.component.ts
blob: 7f508d7f2f733e23e601653bfde022c3bab8ae23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core';
import template from "./search-bar.component.html";

@Component({
    selector: 'sdc-search-bar',
    template: template
})
export class SearchBarComponent {

    @HostBinding('class') classes = 'sdc-search-bar';
    @Input() public placeholder: string;
    @Input() public label: string;
    @Input() public searchQuery: string;
    @Output() public searchQueryClick: EventEmitter<string> = new EventEmitter<string>();

    private searchButtonClick = (): void => {
      this.searchQueryClick.emit(this.searchQuery);
    }
}