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
4 answers

increase count in ng-repeat on every ng-click

step-1- Todo value will increase every click on correspond todo
  • value= {{count}}
  • step-2 - How can i get 'count' and todo…
    ShibinRagh
    • 6,530
    • 4
    • 35
    • 57
    2
    votes
    2 answers

    How to get ng-repeat item inside transcluded template?

    How I can use ngRepeat item inside transcluded template? Is it possible? Directive template: Directive: app.directive('myDirective', function () { return { …
    2
    votes
    3 answers

    How to disable option in Angular JS?

    I have ng-repeat option:
    2
    votes
    1 answer

    AngularJS Multiple ng-repeats on single row of table

    I am trying to display a table with items from both a parent and a list of child objects. Is it possible to do this using ng-repeat? A for loop would look something like this. foreach(var parent in list) foreach (var child in parent) …
    James
    • 493
    • 1
    • 10
    • 37
    2
    votes
    4 answers

    Changing background color of a div on ng-click

    I want to change the background color of a div which already has a backkground color that is white for odd element and grey for even element. Dont know why its not working in Jsfiddle. The div is also having a ng-click which i have not used in…
    RAHUL DEEP
    • 695
    • 3
    • 13
    • 33
    2
    votes
    0 answers

    Ng-repeat with search filter only works on 2nd character keyup

    I'm using a $http get request in my angular application to access data to bind to my view in a loop using ng-repeat and a filter based on a users input value for a simple search. I'm able to access the data and filter and bind the results to my view…
    user4855927
    2
    votes
    3 answers

    Not able to display correct data in table -AngularJS

    Below is my plunker where I have tried to display the data under each category.But the data are not printing as supposed to .Example:-rom value 12345 should come directly under bread. I'm not sure where I'm doing wrong in my code: …
    forgottofly
    • 2,729
    • 11
    • 51
    • 93
    2
    votes
    3 answers

    ng-repeat with *conditional* ng-class by $index

    I'm applying a button to a list-group-item using ng-repeat where the button has a class btn-primary when not selected and a minus glyphico and a class btn-success when selected and an ok glyphicon. I'm trying to apply this conditionally using…
    b0bu
    • 1,062
    • 1
    • 9
    • 24
    2
    votes
    3 answers

    Advice on creating a matrix table in angular JS

    Below is my JSON object(partial) which I would like to show as a matrix table preferably using ng-repeat: [ { "product": "milk", "resource": "a", "checked": true }, { "product": "bread", …
    forgottofly
    • 2,729
    • 11
    • 51
    • 93
    2
    votes
    2 answers

    When Ng-click do ng-show on the clicked element in a ng-repeat

    I am trying to have a element show certain text during a load. The issue that I run into is the elements are repeated in the ng-repeat. When I click on one they all switch vs. just that element. I am not sure how to just target one.
    2
    votes
    1 answer

    AngularJS: why my button are still active with ng-repeat track by $index

    I have a problem with ng-repeat: Here is my html file
    Ludo
    • 133
    • 1
    • 13
    2
    votes
    1 answer

    AngularJS : directive inside ng-repeat not respecting new order

    First, here's the issue reproduced in Plunker. Basically I have a directive that will insert some element based on some info inside an ng-repeat. For my application, I'm using a pretty similar approach where it inserts an ,
    2
    votes
    1 answer

    ng-show angular tab with ng-repeat

    I have been working on this for a while now and cannot figure out why it will not work. This is the effect I am trying to create- http://plnkr.co/edit/RAeIwFbn2Zoe9WfLdMX8?p=preview. I wish to have create a tab bar that when clicked on will show…
    2
    votes
    1 answer

    Update span inner html dynamically on select box change in angularjs

    I have multiple select box on a page with each select box have a span listing its price. On select box change the price update dynamically based on the item. How I can achieve this using angularjs ? My Code below
    2
    votes
    1 answer

    Can't get ng-repeat animations to work in Angular 1.4.4

    I can't get the animations to work when adding items to my list. Html: Top Animation
    robertk
    • 2,461
    • 1
    • 27
    • 39
    1 2 3
    99
    100