![]() |
VOOZH | about |
In this article, we will see how to fetch the details with the help of the ng-repeat directive in Angular, along with understanding its implementation through the illustrations. AngularJS contains various types of pre-defined Directives, where most of the directives start with ng which denotes Angular. The ng-repeat directive is used to iterate over an object for its properties. A template is instantiated once an item is from a collection. Every template has its own scope where the loop variable is set to the current collection item and the $index is set to a key or the index of the item.
Syntax:
<element ng-repeat="(key, value) in Obj"></element>
Parameter values:
Example 1: This example shows the basic usage of the ng-repeat directive to fetch the data in a tabular format.
Output:
Example 2: This is another example illustrating the fetching of data using the ng-repeat directive in AngularJS.
Output: