Free tools Windows power users keep installed
One-click scans. No signup required.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
NG8105 means an Angular *ngFor expression is missing the let declaration for its repeated item. Change *ngFor="item of items" to *ngFor="let item of items". The let keyword declares the template-local variable that refers to each item.
How to fix NG8105
Add let before the item variable in the *ngFor expression:
<div *ngFor="item of items">{{ item }}</div>
Correct it to:
<div *ngFor="let item of items">{{ item }}</div>
Here, item is the template-local name for the current element in items. Without the declaration, Angular cannot bring that variable into the template scope as intended. Angular documents this diagnostic at NG8105: Missing let keyword in an *ngFor expression.
Why let is required
*ngFor is shorthand for an embedded template. In the expanded structural-directive syntax, a local variable is declared with a form such as let-item; the shorthand expression uses let item. It is a declaration, not an optional word. Angular’s structural directives guide explains how shorthand syntax maps to the underlying template.
#1 Best Overall
NgFor creates a view for each item in an iterable collection. Its template context can also expose values such as the current index, and a trackBy function can define how Angular associates items with rendered DOM elements. Those features are separate from NG8105: this diagnostic specifically identifies the missing item declaration.
When Angular reports NG8105
Angular emits extended diagnostics only when strictTemplates is enabled. NG8105 has no additional requirement. Extended diagnostics are warnings by default, so the warning does not block compilation. Angular lets a project configure diagnostics as warnings, errors, or suppressed; an error fails compilation. See Angular’s Extended Diagnostics overview and template type-checking documentation.
Rank #2
Should you suppress the diagnostic?
Usually, no: adding let repairs the expression that triggered NG8105. If a project has a specific reason to silence this check, Angular documents a diagnostic-specific setting in tsconfig.json:
{
"angularCompilerOptions": {
"extendedDiagnostics": {
"checks": {
"missingNgForOfLet": "suppress"
}
}
}
}
Suppression changes whether Angular reports the issue; it does not add the missing declaration or correct the template. Extended diagnostic categories can also be configured as warning or error.
Rank #3
Does Angular’s @for block change the fix?
No. Adding let is the direct correction when keeping an existing *ngFor loop. Separately, Angular’s current NgFor API marks NgFor deprecated since v20.0 and recommends the @for block; removal is intended in a future major release. Treat that as a separate migration decision, and check the Angular version and constraints of your project before changing loop syntax.
Quick Recap
Rank #4
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.

