6/11 ng-repeat="product in products"

hi there,
i don’t understand why it works saying “product in products” when in the MainController there is only ‘products’ given as a property. there is no ‘product’ in singular form. does angularJS simply understand it automatically that ‘product’ is one item from the array ‘products’?

thank you!

product is just your name for the singular piece of information in a data structure. So yes, by saying:

for product in products {

JavaScript knows that you are referring to a singular product.

1 Like