1

I've looked at the examples of using ngInfiniteScroll over at the demo site (http://binarymuse.github.io/ngInfiniteScroll/demos.html) but they all seem to be using the lower level $http service in order to build their scroll. The issue I have is that I already have all my resources built in factories using ngResource because I'm passing in other parameters in other controllers around my app.

I'd like to know if its still possible to use ngInfiniteScroll using $resource instead of $http? I've yet to find one example so far but would like to just request a new page to the REST API like i have down below. Any code examples or ideas how this is done?

  .factory('allUpcomingFactory', function($resource) {
    return $resource('http://www.test.com/api/v1/channel_listings.json?page=:pageID&channel_id=:channelID',
    {channelID: '@channelID', pageID: '@pageID'},
    {'query':  {method:'GET', isArray:false}});
  })
neoswf
  • 4,269
  • 4
  • 35
  • 52
Mr. BigglesWorth
  • 1,500
  • 3
  • 15
  • 31

1 Answers1

0

Angular UI has an infinite scroll directive in their ui-utils package that allows for the creation of a service to drive object retrieval for the scroller. You can check it out here:

https://github.com/angular-ui/ui-utils/tree/master/modules/scroll

jdmcnair
  • 1,255
  • 14
  • 33
  • Does this mean it cannot be done via $resource with ngInfiniteScroll or is this just another solution? Im not sure I need everything in Angular-UI – Mr. BigglesWorth Apr 07 '14 at 00:45
  • To be honest, I haven't used ngInfiniteScroll, so I really don't know whether it can be used the way you're hoping. For what it's worth, you can use the AngularUI scroll directive independently of the rest of Angular UI, so you need not take the entire package. – jdmcnair Apr 07 '14 at 12:34