Angularjs multiple $http.get request

前端 未结 3 1786
渐次进展
渐次进展 2021-01-29 23:35

I need to do two $http.get call and I need to send returned response data to my service for doing further calculation.

I want to do something like below:

3条回答
  •  情深已故
    2021-01-30 00:06

    There's a simple and hacky way: Call the calculation in both callbacks. The first invocation (whichever comes first) sees incomplete data. It should do nothing but quickly exit. The second invocation sees both product lists and does the job.

提交回复
热议问题