From 3c232381294cdeeef1e1991f2d80167ff5fd90d4 Mon Sep 17 00:00:00 2001 From: Suguru Inatomi Date: Wed, 17 Aug 2016 11:39:22 +0900 Subject: [PATCH] docs(ngFor): add documentation for ngForTrackBy (#10780) * docs(ngFor): add documentation for ngForTrackBy * wo/ prefix --- .../@angular/common/src/directives/ng_for.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/@angular/common/src/directives/ng_for.ts b/modules/@angular/common/src/directives/ng_for.ts index 0f4768c879..80be308f29 100644 --- a/modules/@angular/common/src/directives/ng_for.ts +++ b/modules/@angular/common/src/directives/ng_for.ts @@ -62,11 +62,22 @@ export class NgForRow { * elements were deleted and all new elements inserted). This is an expensive operation and should * be avoided if possible. * + * To customize the default tracking algorithm, `NgFor` supports `trackBy` option. + * `trackBy` takes a function which has two arguments: `index` and `item`. + * If `trackBy` is given, Angular tracks changes by the return value of the function. + * * ### Syntax * - * - `
  • ...
  • ` - * - `
  • ...
  • ` - * - `` + * - `
  • ...
  • ` + * - `
  • ...
  • ` + * + * With `