1.<div *ngFor="let product of products; index as productId">
解决策:<div *ngFor="let product of products; let index = productId">
2.this.route.paramMap.subscribe(params => { this.product = products[+params.get(‘productId‘)]; });
解决策:this.route.params.subscribe(params => {this.product = products[+params[‘productId‘]];});
原文地址:https://www.cnblogs.com/wzhw2015/p/12407366.html
时间: 2024-10-12 02:45:31