-1

I have select list:

   <select (change)="onChange($event.target.value)">
            <option
              *ngFor="let option of tab.content.value()"
              [value]="option"
              >{{ option.name }}</option
            >
          </select>

I have tried to get model option as selected value:

onChange(data) {
    console.log(data);
}
Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
POV
  • 11,293
  • 34
  • 107
  • 201

1 Answers1

1

Can you try:

   <select (change)="onChange($event)">
            <option
              *ngFor="let option of tab.content.value"
              [value]="option"
              >{{ option.name }}</option
            >
          </select>


onChange(data: Event) {
    console.log(data.target.value);
}
Yin
  • 437
  • 1
  • 6
  • 15