Learn Courses My Dashboard

M2L12 Challenge - variable number of toppings

How to list the toppings, if my json data’s pizza object has various number of toppings (e.g: one pizza has two toppings and another has three toppings, etc).

How about using a ForEach in your view? If you write your syntax correctly, it could create an element for each item in whatever it’s iterating over.

Thanks for the prompt response. Its not working inside a List. However, M2L13 might have solution for it. Let me check that out first.