ngForTrackBy property

  1. @Input()
set ngForTrackBy (TrackByFn? value)

Optionally; set a function used to determine uniqueness of an element.

See TrackByFn for more details on how to use this parameter type.

Implementation

@Input()
set ngForTrackBy(TrackByFn? value) {
  _ngForTrackBy = value;
  if (_ngForOf != null) {
    final differ = _differ;
    if (differ == null) {
      _differ = DefaultIterableDiffer(_ngForTrackBy);
    } else {
      _differ = differ.clone(_ngForTrackBy);
    }
  }
}