-2

I have upgraded my project from angular 5 to angular 7. After upgrading to latest, slice pipe is not working as expected. It is going into infinite loops in the angular core files. My browser screen also got struct in the same page.

*ngFor="let hero of heroes | slice:0:3;"

When I removed the slice pipe and use *ngIf, page is woking fine.

<div *ngFor="let hero of heroes;let i=index"><div *ngIf="i<3"></div></div>

Thanks in Advance!

Arron
  • 1,134
  • 2
  • 13
  • 32

1 Answers1

0

remove ; from slice use like this *ngFor="let hero of heroes | slice:0:3"