0

Example of behavior:

https://stackblitz.com/edit/angular-ctyf9w

Why am I unable to show the data with *ngFor? Is there any example in some docs on how to show the data and rowspan accordinly the other columns?

1 Answer 1

3

You are not using ngFor correctly. You don't need the index in your case. Change your code from:

<div *ngFor="let price of product.prices; let i = index;">        
    {{ price[i].price }}
</div>

To:

<div *ngFor="let price of product.prices">        
    {{ price.price }}
</div>

Here is your working forked project

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.