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
2
votes
1 answer

Where to handle directive event listeners

My question is basically on handling directive event listeners. I have tiles in my project list screen and each tile will have let's say 6-7 click handlers. I am creating tile as a directive. Also my project list screen can have n no. of tiles. My…
Nandish
  • 125
  • 2
  • 11
2
votes
3 answers

How can I populate array using ng-repeat in Angular JS

How can an array of objects be populated with data using ng-repeat for particular id in AngularJS version 1.4 { "tagTypeDetails": [ { "id": 3, "type": "Project Type", "Tags": [ {"id": 21, "name": "Residential"}, …
Varsha
  • 966
  • 1
  • 9
  • 19
2
votes
3 answers

same ng-repeat data in multiple places in the view

I need to output two lists with data from the same ng-repeat in different parts of the page. For example: // list # 1
// list # 2
2
votes
3 answers

How to handle tree like structure in angularjs?

I am trying to implement a hierarchical structure in the form of a tree in a complex angular.js web app. I am using nested ng-repeats to render the structure but I am getting significant performance related issues in IE 10 and minor performance…
2
votes
1 answer

AngularJS search on button click

I have a form where I want the user to be able to enter in search terms into textboxes, and then click a button to search the list. Is it possible to do something like this with ng-repeat and a button click? I'm really new to Angular, and I'm…
hollyquinn
  • 652
  • 5
  • 15
  • 48
2
votes
1 answer

Angularjs ng-repeat creating inconsistent spacing between list elements

I've encountered a problem with ng-repeat because I'm not getting constistent spacing between list elements. For example, I've declared the following css... .test-grid {} .test-grid ul { list-style: none; } .test-grid li { display:…
CSharp
  • 1,396
  • 1
  • 18
  • 41
2
votes
2 answers

Remove (splice) value from one scope/ng-options, while maintaining values in another

I have a dropdown list populated by one scope and the same list displayed using another scope. When I select something from the dropdown I want to hide/remove it from the display list, but keep the full list in the dropdown. I have a JS fiddle…
crowsfeet
  • 203
  • 1
  • 4
  • 16
2
votes
4 answers

How to filter second level ng-repeat in table

I have an array of objects which I want to display as a table with filter. My filter with model name is filtering the deep object family. This works fine but not the way I want it to work... What I want: Insert string to input, e.g. 'Ma'. Now, I…
DonJuwe
  • 4,477
  • 3
  • 34
  • 59
2
votes
2 answers

How use ng-repeat on ui-grid

How to use ng-repeat on ui-grid and bind attribute to ui-grid dynamically? I was trying something like this:
userbb
  • 2,148
  • 5
  • 30
  • 53
2
votes
1 answer

angular ng-repeat dosen't wait for scope

html
{{item.week}}
script .controller('TimesheetMainCtrl', function ($rootScope, $scope, $window) { dpd.timesheetold.get(function (result, err) { if (err) return console.log(err); …
2
votes
2 answers

Iterate over values which are arrays with ng-repeat

given the following object: { key1: ["val1","val2","val3","val4"], key2: ["val2","val5","val22","val4","val8","val1"], key3: ["val1"], key4: ["val11","val12"] } Is it possible to iterate over all the values in one time using…
TBE
  • 1,002
  • 1
  • 11
  • 32
2
votes
2 answers

ng-repeat filter is empty loop

i do the following ng-repeat loop and it works well!
now i want to check if the filtered is empty, so i…
miholzi
  • 922
  • 1
  • 14
  • 36
2
votes
1 answer

Transform array attribute in AngularJS

I have a plain array in JavaScript: $scope.myArray = [{ "coords" : { "lat" : 0, "long" : 0 } }, { "coords" : { "lat" : 1, "long" : 1 } }, { "coords" : { "lat" : 2, "long" : 2 } }]; Then, I have the angular-google-maps module, to draw these points…
2
votes
2 answers

Retrieving data from json using AngularJS

I am learning angular js from ground up and am currently trying to retrieve data from a json file. I am using - nodejs, express, AngularJS. Earlier I was getting an error "Unexpected token D" on using…
2
votes
3 answers

Dynamic ng-model into ng-repeat AngularJS

I'm trying to generate dynamically ng-model directive in ng-repeat but I receive an error from browser. We get dynamically attributes of a type and I would like to set its in DOM. I'm recieving this error: Error: [$parse:syntax] Syntax Error: Token…