NG8115 means an Angular @for block refers to a tracking function without calling it. Pass the current loop item to that function—such as track trackByName(item)—so the expression returns a tracking key. Angular’s extended diagnostics require strictTemplates to report the warning.
What NG8115 means
In an @for block, Angular evaluates the track expression to associate collection items with their rendered DOM views. The expression should produce a key for the current item. If it names a function but omits the call, Angular receives the function reference rather than the key returned by that function. That is the misuse NG8115 identifies. See Angular’s NG8115 documentation.
As an Amazon Associate I earn from qualifying purchases.
For example, this expression names a function but does not invoke it:
Recommended Free Tools
@for (item of items; track trackByName) {
<li>{{ item.name }}</li>
}
Call the function with the current item instead:
@for (item of items; track trackByName(item)) {
<li>{{ item.name }}</li>
}
How to fix the warning
-
Find the
@forexpression identified in the compiler diagnostic.#1 Best Overall
-
If its
trackexpression names a function intended to calculate a key, invoke it with the loop variable. For example, changetrack trackByNametotrack trackByName(item). -
Check that the function returns a suitable key for each item. A unique, stable property such as
item.idis often appropriate when items may be added, removed, or reordered. The key must distinguish items in the collection and reflect their identity for the updates your collection supports. -
Rebuild or run the project’s usual compiler check and confirm the NG8115 warning is gone. If you expect Angular to report the diagnostic but do not see it, check that
strictTemplatesis enabled.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Choose a tracking key that fits the collection
Invoking the function addresses NG8115, but it does not guarantee that the returned key is a good one. Angular uses tracking keys to connect items to rendered views and make the necessary DOM changes when a collection changes. A stable unique property helps Angular identify the same item across insertions, removals, and moves. Angular’s @for API documentation recommends a unique property for changing collections; $index is a straightforward option when the collection is static.
Rank #3
Configuration, severity, and suppression
NG8115 is an extended diagnostic. Angular requires strictTemplates for extended diagnostics, and NG8115 has no additional configuration prerequisite. Extended diagnostics are warnings by default and do not block compilation; a project can set an individual diagnostic to warning, error, or suppress. Setting it to error makes compilation fail when Angular emits it. Details are in Angular’s Extended Diagnostics guide.
If there is a specific reason to hide NG8115, configure its targeted suppression in the project’s TypeScript configuration:
Rank #4
{
"angularCompilerOptions": {
"extendedDiagnostics": {
"checks": {
"uninvokedTrackFunction": "suppress"
}
}
}
}
Suppression hides the diagnostic rather than correcting the expression. Calling the function and returning an appropriate key is the normal fix.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsHow this differs from legacy *ngFor
NG8115 is about the track expression in the newer @for template block. Legacy *ngFor uses a trackBy directive input, which accepts a function that returns a tracking key. These are different syntaxes: do not put trackBy in an @for block or treat @for’s track expression as the legacy directive input. Angular marks NgFor deprecated since v20.0 and directs users to @for.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




