如何从ion-option获取属性值

时间:2017-03-29 14:42:40

标签: angular ionic2

我有以下选择菜单。我想访问TypeScript-Class中的attr.id。这可能吗?我没找到方法。 friends多维数组。

   <ion-item>
      <ion-label>Service</ion-label>
      <ion-select [(ngModel)]="selectService" name="service" (ionChange)="serviceSelected($event)">
               <ion-option selected disabled value="">Service auswählen:</ion-option>
                <ion-option *ngFor="let friend of friends" [attr.id]="friend[3]">{{friend[1]}}: {{friend[2]}} </ion-option> 
      </ion-select>
    </ion-item>

TS

serviceSelected(friend) 
{
  // How can I get the attribute "id" from the selected value here? 
}

0 个答案:

没有答案
相关问题