Questions tagged [angularjs-ng-repeat]

The `ngRepeat` directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and `$index` is set to the item index or key.

The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key.

Special properties are exposed on the local scope of each template instance, including $index, $first, $middle and $last.

Usage

As an attribute

<ANY ng-repeat="{repeat_expression}">
   ...
</ANY>

Directive info

  • This directive creates a new scope.
  • This directive executes at priority level 1000.

Animations

  • enter - when a new item is added to the list or when an item is revealed after a filter
  • leave - when an item is removed from the list or when an item is filtered out
  • move - when an adjacent item is filtered out causing a reorder or when the item contents are reordered

References:

http://docs.angularjs.org/api/ng.directive:ngRepeat

9074 questions
170
votes
12 answers

How to improve performance of ngRepeat over a huge dataset (angular.js)?

I have a huge dataset of several thousand rows with around 10 fields each, about 2MBs of data. I need to display it in the browser. Most straightforward approach (fetch data, put it into $scope, let ng-repeat="" do its job) works fine, but it…
n1313
  • 20,555
  • 7
  • 31
  • 46
138
votes
2 answers

AngularJS - How can I reference the property name within an ng-Repeat

In addition to rendering the value of the properties in an object, I'd also like to render the property name as a label. Is there a way to do this with ng-repeat? For example:
  • {{propertyName}}:…
Brian Flanagan
  • 4,612
  • 5
  • 29
  • 38
136
votes
20 answers

How to filter multiple values (OR operation) in angularJS

I want to use the filter in angular and want to filter for multiple values, if it has either one of the values then it should be displayed. I have for example this structure: An object movie which has the property genres and I want to filter for…
justGoscha
  • 24,085
  • 15
  • 50
  • 61
133
votes
16 answers

How to make ng-repeat filter out duplicate results

I'm running a simple ng-repeat over a JSON file and want to get category names. There are about 100 objects, each belonging to a category - but there are only about 6 categories. My current code is this: