angular5之后使用pipe
this.http.get('url')
.pipe(
timeout(1000),
catchError(e => {
return of(null);
})
).toPromise().then(
res => {
//成功
}).catch(e => {
//报错
);
标签:null,return,请求,toPromise,pipe,报错,超时,angular
来源: https://www.cnblogs.com/chinadba/p/16701227.html