Track By

With Angular 17+ the @for control-flow block accepts a track expression that supplies a stable identity key. This lets the renderer reuse existing DOM nodes when the underlying array is rebuilt, instead of throwing them away and recreating them.

Basic usage

  • Open devtools F12 and find and select the ul inside the bs-list-group
  • Click the button. Note that only the newly added bs-list-group-item is recreated