반응형

[IONIC2 ] ionic2 -input에서 enter key 입력시 폼 전송하기 


input에서 enter key 입력시 폼전송하기


(keyup.enter)=   : enter key 입력 시 실행


Template:

<ion-searchbar
      [(ngModel)]="searchQuery"
      [showCancelButton]="true"
      (ionInput)="search($event)"
      (keyup.enter)="someFunction($event)">
</ion-searchbar>

Component TS: someFunction(event: KeyboardEvent) { console.log((<HTMLInputElement>event.target).value); }











.

반응형

+ Recent posts