I am trying to implement pagination in my ng-repeat
template, and I am using the code that I found in How to do paging in AngularJS?, namely, this: http://jsfiddle.net/dalcib/J3fjc/.
my code is almost the same as that in this jsfiddle example, except for instead of using hard coded values, I use an injected service that fetches data from a url that returns json.
the problem that I am having is that the length of the collection is always zero in the jsfiddle code, and I do not know why because I am a newbie. here is the relevant code:
...
collection = scope.$eval(rhs),
count = collection.length;
count
is always zero. It looks like the code is executed before the response from the service is received.
can anyone help?