angular.js - angularjs uses the result of the first http request to initiate a second http request. I don't want to write it in a nested manner. How can I implement it elegantly?
巴扎黑2017-05-15 16:54:48
0
3
666
Angularjs uses the result of the first http request to initiate a second http request. I don’t want to write it in a nested manner. How can I implement it elegantly?
To use
promise
, you can read an article I wrote before, I hope it can help you, promise.Use
promise
写法,可以使用$q
service.http://stackoverflow.com/questions/9432587/what-is-the-correct-way-to-chain-async-calls-in-javascript