As you know it\'s possible to use Interceptors in new versions of Angular 4.
In mine, I want to cancel a request in interceptor in some conditions. So i
To Angular 6, you need can user the following structure to return a empty Observable:
import {Observable} from 'rxjs';
import {empty} from 'rxjs/internal/Observer';
//...
intercept(req: HttpRequest, next: HttpHandler): Observable> {
if (stopThisRequest) {
return Observable.create(empty);
} else {
return next.handle(req);
}
}