Tuesday, April 21, 2015

AngularJs ng-repeat directive

ng-repeat directive repeats HTML elements for each item in a collection. In the following example, we iterate over the array of countries.

<div ng-app="">
...
 <p>List of Countries with locale:</p>
 <ol>
 <li ng-repeat="country in countries">
 {{ 'Country: ' + country.name + ', Locale: ' + country.locale }}
 </li>
 </ol>
</div> 

No comments:

Post a Comment