Skip to main content
441 votes
27 answers
421k views

Is there a way to ng-repeat a defined number of times instead of always having to iterate over an array? For example, below I want the list item to show up 5 times assuming $scope.number equal to 5 ...
Malcr001's user avatar
  • 8,289
489 votes
10 answers
350k views

I am defining a custom filter like so: <div class="idea item" ng-repeat="item in items" isoatom> <div class="section comment clearfix" ng-repeat="comment in item.comments | range:1:2"...
Dine's user avatar
  • 7,293
717 votes
8 answers
596k views

In my controller, I have data like: $scope.object = data Now this data is the dictionary with keys and values from json. I can access the attribute with object.name in the template. Is there any way ...
user192362127's user avatar
502 votes
12 answers
877k views

I have an array of products that I'm repeating over using ng-repeat and am using <div ng-repeat="product in products | filter:by_colour"> to filter these products by colour. The filter is ...
Tim Webster's user avatar
  • 9,206
258 votes
24 answers
640k views

Angular does provide some support for a for loop using numbers within its HTML directives: <div data-ng-repeat="i in [1,2,3,4,5]"> do something </div> But if your scope variable ...
matsko's user avatar
  • 22.3k
378 votes
10 answers
239k views

I thought this would be a very common thing, but I couldn't find how to handle it in AngularJS. Let's say I have a list of events and want to output them with AngularJS, then that's pretty easy: <...
Prinzhorn's user avatar
  • 22.6k
212 votes
15 answers
212k views

I want to call some jQuery function targeting div with table. That table is populated with ng-repeat. When I call it on $(document).ready() I have no result. Also $scope.$on('$...
ChruS's user avatar
  • 3,737
231 votes
17 answers
191k views

How can i get a reversed array in angular? i'm trying to use orderBy filter, but it needs a predicate(e.g. 'name') to sort: <tr ng-repeat="friend in friends | orderBy:'name':true"> <td&...
Delremm's user avatar
  • 3,161
1 vote
1 answer
55 views

While creating a custom widget for visualizing dynamic table data, I encountered some issues and would like to share a minimal working example to illustrate the problem. JS: self.ctx.$scope.showAlert =...
OmnivoreRecycling's user avatar
391 votes
8 answers
209k views

How to sort by using multiple fields at same time in angular? fist by group and then by sub-group for Example $scope.divisions = [{'group':1,'sub':1}, {'group':2,'sub':10}, {'group':1,'sub':2},{'group'...
gmeka's user avatar
  • 4,279
401 votes
7 answers
489k views

I have a simple loop with ng-repeat like this: <li ng-repeat='task in tasks'> <p> {{task.name}} <button ng-click="removeTask({{task.id}})">remove</button> </li> ...
Paweł Szymański's user avatar
335 votes
6 answers
195k views

So I have an ng-repeat nested within another ng-repeat in order to build a nav menu. On each <li> on the inner ng-repeat loop I set an ng-click which calls the relevant controller for that menu ...
Tules's user avatar
  • 4,915
187 votes
10 answers
169k views

I have seen this SO question. My code instead of ng-bind="item.desc" uses {{item.desc}} because I have a ng-repeat before. So my code: <div ng-repeat="item in items"> {{item.description}} &...
Diolor's user avatar
  • 13.5k
111 votes
20 answers
262k views

The script below displays a shop cart using ng-repeat. For each element in the array, it shows the item name, its amount and the subtotal (product.price * product.quantity). What is the simplest way ...
keepthepeach's user avatar
  • 1,631
124 votes
21 answers
167k views

I am using ng-repeat with my code I have 'n' number of text box based on ng-repeat. I want to align the textbox with three columns. this is my code <div class="control-group" ng-repeat="oneExt in ...
kuppu's user avatar
  • 1,274

15 30 50 per page
1
2 3 4 5
604