How To Implement Loops Using Ng-Repeat In AngularJS
In AngularJS, ng-repeat directive is similar to for each loop in C#
Loops, Nested loops all can be done by using ng-repeat directive.
Lets start with one example here.
We are trying to show above array within a table.
Within the controller, attach the above array on model object "student".
On the HTML part, create a table with header scetion as above.
Now use ng-repeat directive for producing the table content.
ng-repeat = "student in student"
Second student is the Model Object of the Controller.
It is similar to foreach loop as shown below.
foreach(string obj in table)
Display the array data within double curley bracket inside the td section.
By this way we can Implement Loops Using Ng-Repeat In AngularJS.