quma
quma

Reputation: 5719

Angular 5 - ng-select - input text event

I use the module in my Angular 5 application:

ng-select

My use case is that the user gives in a search term and I load search results from backend concerning to the user input. I can not find an event which fires when user gives in characters. Does anyone know which event I can use or how I can do this

Upvotes: 11

Views: 3293

Answers (2)

miad
miad

Reputation: 23

<ng-select
    placeholder="Select some items"
    [items]="items"
    [(ngModel)]="selectedItems"
    bindLabel="name"
    bindValue="id"
    (search)="onSearch($event)"
</ng-select>

onSearch(event:any){
console.log(event)
}

Upvotes: 0

Dumitriu Sebastian
Dumitriu Sebastian

Reputation: 162

I think that the keyup event is what you are looking for.

You can read more about it here.

Upvotes: 3

Related Questions