coreui / coreui-angular

CoreUI Components Library for Angular https://coreui.io/angular/docs/
https://coreui.io/angular/
MIT License
248 stars 146 forks source link

SelectionChange event #155

Closed 32x0lf closed 1 year ago

32x0lf commented 1 year ago

Hi,

I am trying to get the value of the selected value in Select component. I am using selectchange event but it did not fire or get any value.

HTML

<select cSelect sizing="sm" (selectionchange)="GetRecord($event.value)" >
  <option *ngFor="let data of country" [value]="data.name" >{{data.name}}</option>
</select>

TS

GetRecord(event:any){
  console.log('value',event);
}
xidedix commented 1 year ago

@32x0lf

<select cSelect sizing="sm" (change)="getRecord($event)" >
  <option *ngFor="let data of country" [value]="data.name" >{{data.name}}</option>
</select>
getRecord(event:any){
  console.log('value', event.target.value);
}
32x0lf commented 1 year ago

@xidedix

Thank you so much