Home > OS >  issue in using ngfor, Error : No directive is matched on attribute ngFor Angular 14 used
issue in using ngfor, Error : No directive is matched on attribute ngFor Angular 14 used

Time:07-06

 <tbody>
   <tr *ngFor="let employee of employees">
     <td>{{ employee.firstName }}</td>
     <td>{{ employee.lastName }}</td>
     <td>{{ employee.emailId }}</td>
   </tr>
  </tbody>

im using ngfor But Error sshowing like No directive is matched on attribute ngFor

CodePudding user response:

You need import CommonModule into your module, or component if you are using v14 standalone components. Share a stackblitz example of the error to better understand.

CodePudding user response:

Please import CommonModule inside your custom module. After that include it inside the imports array.

import {CommonModule} from '@angular/common';

imports: [
  CommonModule
]

  • Related