填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

TrackByFunction

An optional function passed into the NgForOf directive that defines how to track changes for items in an iterable. The function takes the iteration index and item ID. When supplied, Angular tracks changes by the return value of the function.

      
      interface TrackByFunction<T> {
  (index: number, item: T): any
}
    

方法

(index: number, item: T): any
      
      (index: number, item: T): any
    
参数
index number
item T
返回值

any