Conditonal For Loop in Angular JS
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2017 02:43 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2017 02:51 AM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2017 02:58 AM
Use like this below with ng-repeat attribute :
<div ng-repeat="i in a">{{i}}</div> // where a is an array

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2017 03:00 AM
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.
ServiceNow Commnunity MVP -2018 class.