0

currently i am using a WCF WebService to provide data for a page with AngularJS. It retrieves all data at first time. What i want to do is to load the first n records and the on click on a button or link, image etc. i want to load the next n records and add it to my model.

How could i achieve this?

STORM
  • 4,005
  • 11
  • 49
  • 98
  • You have to change your service (e.g. adding some parameter) to achieve your goal. – wilver May 24 '15 at 11:05
  • ok, could be more precise please? – STORM May 24 '15 at 12:40
  • You should create a method in your service (e.g. `getRecords(int numRecord=0)` ) and return the specified number of record passed as parameter or all the records if parameter is 0...something like that. See articles like this for guidance: http://www.codeproject.com/Articles/123067/A-Simple-Sample-WCF-Service – wilver May 24 '15 at 13:48
  • Thanks for your reply. I understand that. In case to have a or first n on load its ok for me. My requirement would be to load "more" or better next n data. I better add this to my post. How to go in this case? – STORM May 24 '15 at 17:55
  • you need pagination. There're a lot of resources inside and outside SO: http://stackoverflow.com/questions/741413/implementing-pager-through-wcf-service or http://dzapart.blogspot.it/2013/01/wcf-pagination.html – wilver May 25 '15 at 10:53
  • Thank you! I now know how to implement. The second link is very detailed but i think too overloaded for my purpose. But the idea is now clear and can think about a lightweight implementation based on my needs. How can i mark a comment as helpful? – STORM May 25 '15 at 15:55
  • click the up arrow near the comment :) tnx (or maybe you need some reputation point...I don't remember) – wilver May 25 '15 at 16:40

0 Answers0