3 回答

TA貢獻(xiàn)1808條經(jīng)驗(yàn) 獲得超4個(gè)贊
鈮
.then()
.success()
.then()
.success()
.then()
-承諾API的全部功能,但稍微詳細(xì)一些 .success()
-不回承諾,但略帶約束的語(yǔ)法

TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個(gè)贊
success()
返回原來(lái)的承諾 then()
回報(bào)一個(gè)新的承諾
then()
$http.get(/*...*/). then(function seqFunc1(response){/*...*/}). then(function seqFunc2(response){/*...*/})
$http.get()
seqFunc1()
seqFunc2()
success()
$http(/*...*/). success(function parFunc1(data){/*...*/}). success(function parFunc2(data){/*...*/})
$http.get()
parFunc1()
,parFunc2()
并行

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超8個(gè)贊
then
:
$http.get('/someURL').then(function(response) { var data = response.data, status = response.status, header = response.header, config = response.config; // success handler}, function(response) { var data = response.data, status = response.status, header = response.header, config = response.config; // error handler});
success
/error
:
$http.get('/someURL').success(function(data, status, header, config) { // success handler}).error(function(data, status, header, config) { // error handler});
- 3 回答
- 0 關(guān)注
- 398 瀏覽
添加回答
舉報(bào)