Siv*_*que 1 ionic-framework angular
我使用下面的代码,当我点击时我没有得到id.
<button ion-item (click)="goToDrivePage()" *ngFor="let eventNames of eventType.events">
{{eventNames.id}}
</button>
Run Code Online (Sandbox Code Playgroud)
任何身体帮助我在功能中获得id?
将id值传递给函数
<div *ngFor="let eventNames of eventType.events">
<button ion-item (click)="goToDrivePage(eventNames.id)">
{{eventNames.id}}
</button>
</div>
Run Code Online (Sandbox Code Playgroud)
在ts文件中获取值
goToDrivePage(id : any){
console.log(id);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1276 次 |
| 最近记录: |