Advertisement
Guest User

haye ni

a guest
Jan 22nd, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. Flybits.api.Content.getAll().then(function(resultObj){
  2. // do things with the first page of relevant Content instances
  3. console.log(resultObj.result);
  4.  
  5. // fetch next page of Content instances if it exists
  6. return resultObj.nextPageFn? resultObj.nextPageFn():{};
  7. }).then(function(resultObj){
  8. // do things with the second page of relevant Content instances
  9. console.log(resultObj.result);
  10.  
  11. // fetch next page of Content instances if it exists
  12. return resultObj.nextPageFn? resultObj.nextPageFn():{};
  13. });
  14.  
  15. // assuming previous Content instance retrieval
  16. var contentInstance;
  17.  
  18. contentInstance.getData().then(function(obj){
  19. /**
  20. * assuming Content JSON body
  21. * {
  22. * firstName: "Bob",
  23. * lastName: "Loblaw",
  24. * pets: PagedData
  25. * }
  26. */
  27.  
  28. // bind view to obj.pets.data
  29. console.log(obj.pets.data);
  30. if(obj.pets.hasNext()){
  31. obj.pets.getNext();
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement