1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-25 12:43:36 +00:00
Files
browser/src/app/layout/search/search.component.ts
2021-12-20 15:47:17 +01:00

24 lines
624 B
TypeScript

import { Component } from "@angular/core";
import { FormControl } from "@angular/forms";
import { SearchBarService, SearchBarState } from "./search-bar.service";
@Component({
selector: "app-search",
templateUrl: "search.component.html",
})
export class SearchComponent {
state: SearchBarState;
searchText: FormControl = new FormControl(null);
constructor(private searchBarService: SearchBarService) {
this.searchBarService.state.subscribe((state) => {
this.state = state;
});
this.searchText.valueChanges.subscribe((value) => {
this.searchBarService.setSearchText(value);
});
}
}