Having trouble retrieving the value from data-somedata in my code...
<select class="form-control input-sm" [(ngModel)]="o.id" formControlName="optionals" (change)="menuChange($event)">
<option *ngFor="let menu_optional of menu_optionals" value="{{ menu_optional.id }}" [attr.data-somedata]="menu_optional.id">{{ menu_optional.name }}</option>
</select>
In my component.ts, I have:
menuChange(event) {
console.log(event.data);
}
However, the return is undefined
. I'm looking to retrieve the value stored in data-somedata attribute.