AngularJS - The ng-repeat directive

The ng-repeat  directive is useful to iterate over arrays and objects. In general it can be used across any kind of objects such as rows, lists etc which are a collection of data.

In first AngularJs Simple Program I have used  this directive to present the data which are stored into the array.


and the results are presented bellow


The ng-repeat directive accompanied also from some useful properties:
  • $index - Number - This is the physical number of the element into the object
  • $first - Boolean - If this is the first element then return True otherwise False
  • $last - Boolean - If this is the last element then return True otherwise False
  • $middle - Boolean - If this is the middle element then return True otherwise False
  • $even - Boolean - If this is even element then return True otherwise False
  • $odd - Boolean - If this is odd element then return True otherwise False


And the reuslts are:




Δεν υπάρχουν σχόλια: