Reputation: 33
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
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
Reputation: 21
I believe you need to use of instead of for
try: *ngFor="let data of prescription"
Upvotes: 2
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