trackById is the identity value on an IterableChangeRecord when a trackBy function is used. It lets an iterable directive associate collection items with their rendered views. section 15.3.4
A custom structural directive can use trackById to:
- Index a Map of item identities to PaIteratorContext objects and their ViewRef instances. section 15.3.4
- Retrieve and remove the view associated with an item reported by forEachRemovedItem. section 15.3.4
- Preserve accurate positional context after removals by updating the remaining contexts. section 15.3.4
Deleting a product row
A product table renders rows with a custom paFor directive and a Delete button. Deleting a product changes the data model; the directive uses the recorded identity to find the corresponding view, remove it, and keep row-dependent bindings correct.
