import { ChangeDetectionStrategy , Component } from '@angular/core' ; import { FormControl , FormGroup } from '@angular/forms' ; @ Component ( { selector : 'uxd-toolbar-search' , templateUrl : './toolbar-search.testpage.component.html' , styleUrls : [ './toolbar-search.testpage.component.less' ] , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class ToolbarSearchTestPageComponent { expanded : boolean ; searchText : string ; searchedFor : string = '' ; alwaysExpanded : boolean = false ; form = new FormGroup ( { search : new FormControl ( '' ) } ) ; onSearch ( searchText ) { this . searchedFor = searchText ; this . expanded = false ; } onSearchRight ( ) { this . searchedFor = this . form . controls . search . value ; } }