Wednesday, February 11, 2015

ng-repeat directive

The ng-repeat directive can be used to iterate through a collection and process one item at a time from the collection. This is similar to the foreach loop in C#. The ng-repeat directive comes in handy when we want to display a list of items in an array/collection in the view.

The following example shows how to use the ng-repeat directive to display a list of array items using the ng-repeat directive.

<html ng-app>
    <meta charset="utf-8" />
    <title>AngularJS - Basic</title>
    <script src="angular.min.js"></script>
<div ng-init="Numbers=[1,2,3,4,5]">
   <li ng-repeat="n in Numbers">
     {{ n }}


Search Flipkart Products:

No comments: