$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");
});
随机推荐
- UVA 1626 区间dp、打印路径
uva 紫书例题,这个区间dp最容易错的应该是(S)这种匹配情况,如果不是题目中给了提示我就忽略了,只想着左右分割忘记了这种特殊的例子. dp[i][j]=MIN{dp[i+1][j-1] | if( ...
- 解决tomcat中jdk1.5运行日志相差8小时问题
tomcat运行日志时间与电脑中的时间相差8小时,原因是因为jdk1.5的原因: 解决办法是在jdk运行的时候加上默认参数: Window->Preferences->Java->I ...
- HTTP metadata数据
信息元位置 信息元名称 信息元ID 信息元描述 1 MetadataVersion 5000 Metadata版本号 当前版本号为1.0 2 MetadataID 1019 MetadataID 3 ...
- mysql 库与表操作
1. 库操作 1.1. 创建数据库 语法规则:create database 库名; CREATE DATABASE dt55; 在创建库时,希望指定编码语法:create database 库名 c ...
- 使用ZooKeeper实现Java跨JVM的分布式锁
一.使用ZooKeeper实现Java跨JVM的分布式锁 二.使用ZooKeeper实现Java跨JVM的分布式锁(优化构思) 三.使用ZooKeeper实现Java跨JVM的分布式锁(读写锁) 说明 ...
- 013对象—— __clone __toString __call
<?php /** * */ //__clone()方法对一个对象实例进行的浅复制,对象内的基本数值类型进行的是传值复制 /*class a { public $uname; public $n ...
- docker 创建镜像,并推送到私有仓库
创建镜像 创建 Dockerfile 镜像命名规则:registyr_url / namespace / depart / name : version 用这个规则创建的镜像,可直接推送到私有仓库 ...
- SPS和PPS有哪些重要的参数?
SPS: Level_idc: Bit_depth_luma_minus8: Bit_depth_chroma_minus8: Pic_order_cnt_type: Num_ref_frames: ...
- GeoWebCache的配置与使用
最近在做一个开源GIS的demo的工作,工作中涉及到了地图瓦片,选取的开发环境是geoserver+openlayers,那么地图瓦片自然而然也就使用geowebcache,geowebcache就相 ...
- libQt5Core.so: undefined reference to `dlclose@GLIBC_2.4'
/******************************************************************************** * libQt5Core.so: u ...