1
我正在使用下面的代码,当我点击时,我没有得到id。如何在使用角度和离子点击按钮时获取id?
<button ion-item (click)="goToDrivePage()" *ngFor="let eventNames of eventType.events">
{{eventNames.id}}
</button>
任何机构帮助我获得ID的功能?
我正在使用下面的代码,当我点击时,我没有得到id。如何在使用角度和离子点击按钮时获取id?
<button ion-item (click)="goToDrivePage()" *ngFor="let eventNames of eventType.events">
{{eventNames.id}}
</button>
任何机构帮助我获得ID的功能?
id值传递给函数
<div *ngFor="let eventNames of eventType.events">
<button ion-item (click)="goToDrivePage(eventNames.id)">
{{eventNames.id}}
</button>
</div>
在TS文件中获得的价值
goToDrivePage(id : any){
console.log(id);
}
是它的正常工作 –