rajan khuva
rajan khuva

Reputation: 33

Can't bind to 'ngForFor' since it isn't a known property of '<tr>'

i have type tr *ngFor="let data for prescription"> in my desplay page. but having error Uncaught Error: Template parse error.i'm using angular 5 and unable to start loop in .

Upvotes: 0

Views: 1000

Answers (3)

Jeeten Parmar
Jeeten Parmar

Reputation: 5757

You are using wrong. If you want to use for loop in Angular then you need to use *ngFor.

i.e.
<tr *ngFor="let test of testData"> <td>{{test?.id}}</td> </tr>

Make sure, you import CommonModule from @angular/common in your app module.

Upvotes: 2

ccrooke
ccrooke

Reputation: 21

I believe you need to use of instead of for

try: *ngFor="let data of prescription"

Upvotes: 2

rajan khuva
rajan khuva

Reputation: 33

actually i made mistake in syntax i wrote ngFor="let data for prescription" but i should write of instead of for.

Upvotes: 2

Related Questions