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

ng-repeat filter on certain field

I have a data like below: [ { id: 1, name: 'test', point: '2000' }, { id: 2, name: 'bob', point: '1000' }, { id: 3, name: 'hello', point: '3000' }, { id: 4, name: 'xx', point: '4000' }, { id: 5, name: 'zz', point: '1000' }, { id: 2, name:…
Tss
  • 88
  • 4
  • 13
2
votes
2 answers

Angular - Error: [ngRepeat:dupes] when using $http to get data

Hi I just started using AngularJs, I am having issue when using $http to get data and $scope.productInfos = data returns Error: [ngRepeat:dupes], below is my code: $scope.processForm = function(formData) { $http({ method :…
Mike
  • 173
  • 1
  • 1
  • 12
2
votes
2 answers

How to assign value to angular material checkbox in angularjs

I am using the Angular Material checkbox in my application. I am facing problem in assigning the value to a checkbox.
Mangoski
  • 2,058
  • 5
  • 25
  • 43
2
votes
1 answer

ng-repeat: how do I properly reference $odd or $even by variable?

How can I reference $odd or $even by variable in ng-repeat? I am trying to do this: these are odd{{item}}
these are even {{item}}
By doing this:
2
votes
2 answers

Multiple step angular ng-repeat for performance gain

I've read a lot of suggestions on how to improve performance of an ngRepeat but I couldn't still understand how to achieve my goal. I have this template:
2
votes
1 answer

How to fix a Bootstrap Carousel 'offSetWidth' error

I'm using bootstrap carousel to slide through data I'm bringing in from an external API. The first element in the API array shows up on the carousel, but when I press a 'next' or 'prev' arrow button, the screen blinks and I get this error: Uncaught…
2
votes
1 answer

Materialize button inside ng-repeat not triggering modal

I am using materialize.js for a project and I have an ng-repeat element with contents of my user array: `
` The standard button
HGB
  • 2,157
  • 8
  • 43
  • 74
2
votes
1 answer

Angular infinite scroll + deckgrid ng-repeat render cards only on newly fetched data

I am using deckgrid in conjunction with a custom built infinite scroller to load a continuous stream of photos in Angular laid out in a masonry layout. The data set returned each time is quite large and I had noticed that deckgrid calls…
2
votes
1 answer

Use $setValidity in ng-repeat input

I have a form that it repeated in a ng-repeat. I put part of my form in blow. for custom validation I want to use $setValidity in controller. But I cant to get input name by index in controller. How I use $scope.form.name1.$setValidity("size",…
Hadi J
  • 16,989
  • 4
  • 36
  • 62
2
votes
2 answers

Adding a dynamic directive inside another directive template in AngularJS

I want to add dynamic directive inside another directive tempalte. As you see I want to add another directive inside a directive template How do add those dynamic directive there Please help return { restrict: 'AE', require :'^awkGrid', templateUrl:…
2
votes
2 answers

Angularjs - set value ng-click inside ng-repeat on an item

I load quite a few videos on the page, from youtube. I want to replace the div with placeholder, and only request the video when user clicks on the placeholder image. I got this part working where it loads the video on ng-click, but it loads all of…
2
votes
1 answer

My AngularJS code doesn't work

I am learning AngularJS and ended up with the following code for ToDoList basic app. I viewed it in a browser it didn't work. I am new to the Angular and mightn't get obvious things, so I thought if my app name is todoApp Then I should…
2
votes
4 answers

Save all the values in input text box that is in ng-repeat

I'm figuring out how can I save the values that are entered in the input text box inside ng-repeat on a single click of a button.I have seen examples like this getting values from text box that lets user to save each text box individually. Below is…
forgottofly
  • 2,729
  • 11
  • 51
  • 93
2
votes
1 answer

How to add items to nested angular-ui-tree list after reorder?

I have a nested list of items, something like Day > Exercises > Sets. Each day can have many exercises and each exercise can have many sets. For each list there is a add button. Everything works great until you reorder them using…
2
votes
0 answers

Inserting ng-repeat into DOM on-click and having it render

I am trying to insert an ng-repeat into the DOM and then have it render based on an array I am passing to $scope for the view's controller Controller: angular.module('myApp') .controller('LookBookCtrl',…
mcclaskiem
  • 394
  • 1
  • 15
1 2 3
99
100