Cannot read property 'toUpperCase' undefined with ERROR on * ngFor

I try to declare an index in * ngFor, but I get a type error and it says

<div class='text' *ngFor='let item of blogs; let i = index | async | filter : 'feat' : true'> 

If I output let i = index , it works fine, but I want to use an index, so I can apply css classes to elements. Look at the documentation, here's how you should do it.

+5
source share
1 answer

It must go to the index

 <div class='text' *ngFor='let item of blogs | async | filter : 'feat' : true'; let i = index > 
+10
source

Source: https://habr.com/ru/post/1266863/


All Articles