The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Conditonal For Loop in Angular JS

uma17
Tera Guru

Hi All,

I want to implement the for loop as below in Angular JS

for(i=0;i<a.length;i++)

How can add the condition i<a.length , where 'a' is   an array.

Thanks,

Uma

3 REPLIES 3

Inactive_Us1474
Giga Guru

Use like this below with ng-repeat attribute :


<div ng-repeat="i in a">{{i}}</div> // where a is an array





Karthik Reddy T
Kilo Sage

Hello Uma,



Refer below links may helpful to you.



javascript - (AngularJS) how to loop through an Array - Stack Overflow \


foreach loop in angularjs - Stack Overflow


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.