Angular official website examples of wrong solution

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

Guess you like

Origin www.cnblogs.com/wzhw2015/p/12407366.html