Boa tarde, Eu baixei o projeto completo da parte 4 do curso, porém quando tento executar ocorre vários erros.
ERROR in src/app/shared/components/loading/loading.interceptor.ts(27,13): error TS2322: Type 'Observable<{} | HttpProgressEvent | HttpSentEvent | HttpHeaderResponse | HttpResponse | Http...' is not assignable to type 'Observable<HttpEvent>'. Type '{} | HttpProgressEvent | HttpSentEvent | HttpHeaderResponse | HttpResponse | HttpUserEvent<a...' is not assignable to type 'HttpEvent'. Type '{}' is not assignable to type 'HttpEvent'. Type '{}' is not assignable to type 'HttpUserEvent'. Property 'type' is missing in type '{}'.
o método está assim: intercept(req: HttpRequest, next: HttpHandler): Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse | HttpUserEvent> {
return next
.handle(req)
.pipe(tap(event => {
if(event instanceof HttpResponse) {
this.loadingService.stop();
} else {
this.loadingService.start();
}
}))
.pipe(catchError(err => {
this.loadingService.stop();
throw err;
}));
}