Error: Can't bind to 'ngForIn' . Angular 4+
Asked Answered
C

2

12

this question has already been said but unfortunately no answer worked for me.

Here is my problem (angular 5):

<option 
    *ngFor="let country in countries" 
    [value]="country.id" >
       {{'page.choose_country' | translate}} *
</option>

I have a simple code but it still shows me this error:

Can't bind to 'ngForIn' since it isn't a known property of 'option'.

It does not accept *ngFor in select (I tested in input same result)

I've found several answers like commModule and bowersModule that need to be imported into the module or put b..... I tried to find solutions here, but nothing works.

I hope you've understood me a little bit, despite my scary English. Thank you for your response

Cadre answered 23/11, 2017 at 14:3 Comment(0)
P
40

It needs to be of instead of in

*ngFor="let country of countries" 
Plethoric answered 23/11, 2017 at 14:4 Comment(0)
T
6

Change

*ngFor="let country in countries" 

to

*ngFor="let country of countries" 

There is no such thing ngForIn introduced from Angular side : Ref Link

Termitarium answered 23/11, 2017 at 14:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.