angular2を使用すると、クリック時に現在の*ngFor
のインデックス値を取得できますか? クライアントのリストがあり、インデックス値を取得したいと考えています。クリックで現在のインデックスを取得する方法angular2
<button ion-item *ngFor="let customer of customers" (click)="showRadio()">
{{ customer.customer_name }}
</button>
showRadio(currentIndex) {
//................
for(var j=0; j<myResult[currentIndex].bookingIds.length; j++) {
alert.addInput({
type: 'radio',
label: myResult[currentIndex].bookingIds[j],
value: myResult[currentIndex].bookingIds[j],
checked: false
});
}