Angular官网例子错误的解决

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']];});

猜你喜欢

转载自www.cnblogs.com/wzhw2015/p/12407366.html