//////1

$http.get("/api/task/165/").then(
function(a){
console.log(a);
},
function(b){
console.log(b);
}
)
.then(function(e){
console.log("e");
})
.then(function(){
console.log("err");
});

/////2

$http.get("/api/task/1651/").then(
function(a){
console.log(a);
}
)
.catch(function(err){
console.log(err);
})
.then(function(e){
return $http.get("/api/task/165/");
})
.then(function(res){
console.log(res);
})

////3

$http.get('https://api.github.com/users/peterbe/gists')
.success(function(data) {
$scope.gists = data;
})
.error(function(data, status) {
console.error('Repos error', status, data);
})
.finally(function() {
console.log("finally finished repos");
});
$http.get('https://api.github.com/users/peterbe/gists')
.then(function(response) {
$scope.gists = response.data;
})
.catch(function(response) {
console.error('Gists error', response.status, response.data);
})
.finally(function() {
console.log("finally finished gists");
});

随机推荐

  1. Codeforces Round #451 (Div. 2)

    水题场.... 结果因为D题看错题意,B题手贱写残了...现场只出了A,C,E A:水题.. #include<bits/stdc++.h> #define fi first #defin ...

  2. time模块详解

    本文转自这里: 在Python中,与时间处理有关的模块就包括:time,datetime以及calendar.这篇文章,主要讲解time模块. 在开始之前,首先要说明这几点: 在Python中,通常有 ...

  3. display:inline-block 和 float 水平排列区别?

    文档流(Document flow):浮动元素会脱离文档流,并使得周围元素环绕这个元素.而inline-block元素仍在文档流内.因此设置inline-block不需要清除浮动.当然,周围元素不会环 ...

  4. [eShopOnContainers 学习系列] - 01 - Roadmap and Milestones for future releases

    https://github.com/dotnet-architecture/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future- ...

  5. VMware安装VMwareTolls

    要先启动Ubuntu,用root用户进入. 然后点击VMware的虚拟机——设置——安装VMwareTools 桌面会有一个安装包,解压后,执行vmware-install.pl 安装需要等别以为是安 ...

  6. Java(Android)线程池妙用

    介绍new Thread的弊端及Java四种线程池的使用,对Android同样适用.本文是基础篇,后面会分享下线程池一些高级功能. 1.new Thread的弊端执行一个异步任务你还只是如下new T ...

  7. 【python】利用h5py存储数据

    两类容器:group & dataset group类似文件夹,字典. dataset是数据集,类似数组 支持更多的对外透明的存储特征,数据压缩,误差检测,分块传输 group下面可以是gro ...

  8. vsftpd的530 Login incorrect错误解决方法 vsftpd登录错误

    530 Login incorrect只有用匿名anonymous才可登录,其余所有用户都报530 Login incorrect错 复制代码 代码如下: local_enable=YESwrite_ ...

  9. Unity3D开发之Matrix4x4矩阵变换

    在Unity开发中时常会用到Matrix4x4矩阵来变换场景中对象的位置.旋转和缩放.但是很多人都不太理解这儿Matrix4x4变换矩阵.通过DX中的变换矩阵我来讲一讲在unity中这个变换矩阵是怎么 ...

  10. [QT][待解决问题]对话框ui载入卡顿问题

    电脑运行环境:win7 + qt-opensource-windows-x86-mingw530-5.8.0源码是 < Qt快速入门系列教程目录 > 第3篇 Qt5基础(三)Qt登录对话框 ...