Resolved : Can’t bind to ‘ngForIn’ since it isn’t a known property of ‘img’

The error message is because you used the in keyword instead of the of keyword in the *ngFor directive. The of keyword is used to iterate over arrays, while the in keyword is used to iterate over object properties.

Problem:

In my case I was trying to iterate the images by using below which is incorrect:

<img*ngFor="let imageUrl in images" />

Solution:

So in your case, since images is an array, we should use of instead of in:

<img *ngFor="let imageUrl of images" >

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top