View updates
This commit is contained in:
@@ -14,7 +14,7 @@ export class LoaderInterceptor implements HttpInterceptor {
|
||||
private tasks: number = 0;
|
||||
|
||||
constructor(
|
||||
private _data: DataService
|
||||
private data$: DataService
|
||||
) { }
|
||||
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
@@ -29,14 +29,14 @@ export class LoaderInterceptor implements HttpInterceptor {
|
||||
addTask() {
|
||||
this.tasks++;
|
||||
if (this.tasks === 1) {
|
||||
this._data.showLoader.next(true);
|
||||
this.data$.showLoader.next(true);
|
||||
}
|
||||
}
|
||||
|
||||
removeTask() {
|
||||
this.tasks--;
|
||||
if (this.tasks === 0) {
|
||||
this._data.showLoader.next(false);
|
||||
this.data$.showLoader.next(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user