0
我的代码是如何使用角度2中的Observable获得http响应(成功或失败)?
this.slimLoaderService.start();
return this.http.post(url, data, options)
.map(this.getResult)
.catch(this.handleError);
我需要添加一个this.slimLoaderService.complete();一旦我得到http响应就停止加载器。
您需要申请才能真正发送请求。您将在subscribe函数中编写您的slimLoaderService.stop()代码。 – Sefa
添加'.finally(()=> this.slimLoaderService.complete())'。 –
@JBNizet酷它工作得很好。我不知道最后的方法,我试着做但得到了一些问题,谢谢 – Niyaz