Advertisement
Guest User

Docmarten

a guest
May 28th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. var call1 = $http({url: 'http://www.foobar.com', cache:'false'
  2. }).then(function(response1){
  3. //process response1
  4. return response1
  5. },function(response){
  6. //process error
  7. }) ;
  8.  
  9. var call2 = $http({url: 'http://www.foobar.com', cache:'false'
  10. }).then(function(response2){
  11. //process response2
  12. return response2
  13. },function(response){
  14. //process error
  15. }) ;
  16.  
  17. $q.all([call1,call2]).then(function(response){
  18. for (var x=0,x<response.length;x++) {
  19. //process response1 and response2
  20. }
  21. return processedResponses ;
  22. }
  23.  
  24. // Because call1 and call2 are pretty much identical, I should see the same data twice in "processedResponses" - and I am.
  25. // however in the inspector/debug tool I am only seeing ONE call to http://www.foobar.com when I am expecting to see two calls
  26. //
  27. // Thus is call2 not actually happening because call1 is cached and thus response2 is simply pulled from response1???
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement