最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

AngularJS如何調(diào)用外部接口?

AngularJS如何調(diào)用外部接口?

倚天杖 2018-12-19 22:18:35
AngularJS如何調(diào)用外部接口?
查看完整描述

1 回答

?
斯蒂芬大帝

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超8個(gè)贊

H5edu教育html5開(kāi)發(fā) 培訓(xùn)為您解答:
angularjs $http調(diào)用接口的四種方式:
1.$http.get("/merchantmall/merchant.json")
.success(function(data, status, headers, config) {
console.log(arguments);
})
.error(function(data, status, headers, config) {
console.log(arguments);
})

2.$http({
url: "/merchantmall/merchant.json",
}).success(function(data, status, headers, config) {
console.log(arguments);
}).error(function(data, status, headers, config) {
console.log(arguments);

})

3.var promise = $http({
method: 'GET',
url: '/api/users.json'
});

promise.then(function(resp){
// resp是一個(gè)響應(yīng)對(duì)象
}, function(resp) {
// 帶有錯(cuò)誤信息的resp
});

4.var promise = $http({
method: 'GET',
url: '/api/users.json'
});
promise.success(function(data, status, headers, config){
// 處理成功的響應(yīng)
});
// 錯(cuò)誤處理
promise.error(function(data, status, headers, config){
// 處理非成功的響應(yīng)
});



查看完整回答
反對(duì) 回復(fù) 2019-01-07
  • 1 回答
  • 0 關(guān)注
  • 1048 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)