このようなコードを書くにはどうすればよいですか?複数回は、以前のリクエストのレスポンスを使用して、さまざまなソースとテーブルから新しいURLとエラスティック検索クエリを作成する必要があります。angular.jsのより良い順次呼び出しを書くには?
$scope.whatIFinallyWant = {};
$http.get(url1).then(function(response1){
// creating new url2 & query with response1
$http.get(url2).then(function(response2){
// creating new url3 & query with response2
$http.get(url3).then(function(response3){
// creating new url4 & query with response3
$http.get(url4).then(function(response4){
// using the final response in UI ...
$scope.whatIFinallyWant = response4;
})
})
})
})
'同期promise'のような約束を - 約束は、新しいURLを作成するためのロジック設計 –