how to use track by inside ngFor angular 2

前端 未结 5 1728
天命终不由人
天命终不由人 2020-11-28 11:59

tried every syntax i can guess couldnt make it works !



{{post|json}}
         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 12:29

    As you already recognized, using a function is the only way to use trackBy in Angular 2

    
    

    The official documentation states that https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html

    All the other information about is wrong. Starting with Angular 2.4.1 this will also throw an error in the application.

提交回复
热议问题