search

Home  >  Q&A  >  body text

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?

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?

巴扎黑巴扎黑2871 days ago683

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-15 16:56:48

    To use promise, you can read an article I wrote before, I hope it can help you, promise.

    reply
    0
  • 阿神

    阿神2017-05-15 16:56:48

    Use promise写法,可以使用$q service.

    reply
    0
  • 怪我咯

    怪我咯2017-05-15 16:56:48

    http://stackoverflow.com/questions/9432587/what-is-the-correct-way-to-chain-async-calls-in-javascript

    reply
    0
  • Cancelreply