How to get attribute value from ionic option

I have the following selection menu. I want to access attr.id in TypeScript -Class. Is it possible? I haven't found a way. friends

multidimensional array.

   <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? 
}

      

+3
angular ionic2


source to share


No one has answered this question yet

Check out similar questions:

401
ngFor with index as value in attribute
five
Setting ngModel default angular 2
3
ion-select does not display the selected value when using filtered data
2
IonSelect and ionCheckBox not working when binding to array variables
1
How do I set the value of an option element to order?
0
How to pass all object from NgFor to my component controller
0
Corner 4 selectable bidirectional communication window
0
fill the ionic list with names based on the value in the ion selection
0
Ionic 3 custom selector for ion-option
0
How to pass value from html to typescript and get value from for loop



All Articles
Loading...
X
Show
Funny
Dev
Pics