Skip to content Skip to sidebar Skip to footer

Angularjs With Ng-scroll And Ng-repeat

Using angular-ui with angular. Markup includes an ng-scroll element, which I have working with retrieved data from a service. I'd like to create rows of items so an ng-repeat insid

Solution 1:

I had to wrap each inner array in a dummy "row" hash. Angular doesn't like arrays of arrays, it expects arrays of objects. This markup works with the new json:

<div class="row" >
  <divclass="col-md-12" ><divclass="video_thumb"ng-scroll='video_list in VideoIndexScrollerSource'buffer-size='10'padding="2" ><divclass="row"ng-repeat="video in video_list.row"><p><ang-href="/guides/{{video._id}}"target="_self"><imgng-src="{{video.thumb}}"></a></p></div></div></div></div>

Solution 2:

I've seen this when setting the Angular $resource method to get when you're receiving an array (or otherwise not setting isArray:true when receiving an array).

The method query expects an array (docs):

'query': {method:'GET', isArray:true},

get expects an object:

'get': {method:'GET'},

Post a Comment for "Angularjs With Ng-scroll And Ng-repeat"