Reputation: 29
Here is my code: I want to use onSelect type triggering instead of change, Any help is most welcome.
<select multiple (change)="setSelected($event.target)">
<option *ngFor="let accessKey of accessKeys" [ngValue] = "accessKey">
{{accessKey.name}}</option>
</select>
Upvotes: 1
Views: 6952
Reputation: 944
You can use ngModelChange
<select multiple [ngModel]="selectedOptions" (ngModelChange)="setSelected($event.target)">
<option *ngFor="let accessKey of accessKeys" [ngValue] = "accessKey">
{{accessKey.name}}
</option>
</select>
Upvotes: 1
Reputation: 86800
you can simpply use primeng's Multiselect see here for more info
Upvotes: 4