Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

NG8105: Missing `let` keyword in an *ngFor expression

Description

This diagnostic is emitted when an expression used in *ngFor is missing the let keyword.

      
      import {Component} from '@angular/core';

@Component({
  // The `let` keyword is missing in the `*ngFor` expression.
  template: `<div *ngFor="item of items">{{ item }}</div>`,
  // …
})
class MyComponent {
  items = [1, 2, 3];
}
    

How to resolve the problem

Add the missing let keyword.

      
      import {Component} from '@angular/core';

@Component({
  // The `let` keyword is now present in the `*ngFor` expression,
  // no diagnostic messages are emitted in this case.
  template: `<div *ngFor="let item of items">{{ item }}</div>`,
  // …
})
class MyComponent {
  items = [1, 2, 3];
}