dev*_*abe 3 javascript angularjs
我想我的AngularJS应用程序捕获"没有互联网连接",就像Chrome捕获它一样.当Chrome捕获它时,它会在console.log上显示net :: ERR_INTERNET_DISCONNECTED.
Angular的HTTP拦截器无法捕获它.我得到的唯一数据是rejection.data.status undefined rejection.status 0
到目前为止,这一直很好.我注意到当它无法联系任何东西时状态为0.这是我的http拦截器内部
responseError: function (rejection) {
if (rejection.status == 0) {
// put whatever behavior you would like to happen
}
// .......
return $q.reject(rejection);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5791 次 |
| 最近记录: |