This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

TrackByFunction

An optional function passed into NgForOf that defines how to track items in an iterable (e.g. fby index or id)

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

Methods

(index: number, item: T): any
      
      (index: number, item: T): any
    

Parameters

index

Type: number.

item

Type: T.

Returns

any