Get SearchBar value reactively


#1

Hi,

I used to have this code in Ionic2-beta10

      <ion-searchbar [ngFormControl]="searchControl"
                     [class.visible-clear-icon]="searchControl.value"
                     (keyup.enter)="searchKeyPressed()">
      </ion-searchbar>

and I could write something like:

someothersteamlogic
.combineLatest(this.searchControl.valueChanges
        .distinctUntilChanged()
        .startWith(''),
      (c, t) => ({ c, t }))
      .subscribe(result => ... do something with both data and term.

I noticed that ngFormControl has been deprecated in Beta11. How can I do something similar with SearchBar without wrapping it to a form (in order to build a reactive form) etc…?