You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using HttpInterceptorService in place of Http, the complete callback is not being fired for the returned observables.
Screenshots or link to CodePen/Plunker/JSfiddle
Example:
let http: HttpInterceptorService;
public getDataPromise() : Promise<any> {
let promise = this.http.get('/some/url').toPromise();
return promise.then((data) => {
console.log('this function will never be called');
},
(error) => {
console.log('this will be called if there was an error');
});
}
The promise will never have its resolve method called because toPromise returns a promise that only resolves once the observable is complete.
What is the expected behavior?
The completecallback should be called. Many methods call subscribeand provide a callback for complete.
Which version of Angular and Material, and which browser and OS does this issue affect?
All browsers/versions.
Other information
In lines 52-62 of http-interceptor.service.ts you can see where the nextand errormethods are called for subscriber, but complete is never hooked up.
The text was updated successfully, but these errors were encountered:
Bug Report
When using HttpInterceptorService in place of Http, the
complete
callback is not being fired for the returned observables.Screenshots or link to CodePen/Plunker/JSfiddle
Example:
The promise will never have its resolve method called because
toPromise
returns a promise that only resolves once the observable is complete.What is the expected behavior?
The
complete
callback should be called. Many methods callsubscribe
and provide a callback forcomplete
.Which version of Angular and Material, and which browser and OS does this issue affect?
All browsers/versions.
Other information
In lines 52-62 of http-interceptor.service.ts you can see where the
next
anderror
methods are called for subscriber, butcomplete
is never hooked up.The text was updated successfully, but these errors were encountered: