$http questions
//////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");
});
随机推荐
- 不能在Python Console中运行pytest
在Python Console中运行pytest发现报错了 这是为什么?因为Python Console已经是进入python之后的环境,就像在python自带的IDLE中运行pytest pytes ...
- Chrome浏览器导入数字证书
1.打开 chrome ,点击 右上角的选项图标,在下拉列表中找到 设置 . 2.在设置页面中,滚动到页面的最底部,找到,并点击显示高级设置,找到 HTTPS/SSL 这一项,点击 管理证书 按键.
- 命令行连接db2数据库
在cmd界面执行db2cmd命令 然后在db2cmd界面执行db2命令 然后执行 CONNECT TO UIBS USER DB2INST1 USING 123456命令
- docker 私有registry 配置
备注:此处使用linux镜像配置仓库 registry 启动步骤 https://hub.docker.com/_/registry/ docker login docker pull registr ...
- js区分字符串和数字,有时候需要将字符串转换成数字
js区分字符串和数字,有时候需要将字符串转换成数字 :parseInt
- LeetCode OJ:Multiply Strings (字符串乘法)
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: Th ...
- 2017.10.26 ECN + product spec+ cypress ble module test+
1 ECN Ecn should be issued when modifying drawing,Copy children BOM of subassembly from BIL if one ...
- macOS 下 Visual Studio Code(VSCODE)安装配置及应用
Visual Studio Code 重新定义了 Code 编辑. 在任何操作系统上编辑和调试应用程序内置 Git 支持1000 种以上的扩展免费和开源 为什么使用VSCODE? 我们来看看以下功能: ...
- ROS中使用ABB Yumi IRB14000的一些资料汇总
目前,ABB RobotStudio 已经更新到6.05.01了,可至官网下载. 使用ABB RobotStudio和ROS进行联合调试,请参考下文: http://blog.csdn.net/Zha ...
- 运用 jenkins 让你的项目优雅的持续化集成
0.到系统管理->系统设置 1.安装插件 Publish over SSH 2.配置 Publish over SSH 参数 1.pass 是私钥密码,此私钥文件放在安装 jenkins 的主机 ...