I have repetitive problem in angular but I had search a lot about this problem and use all of Technics that answer in stackoverflow and... .

my problem is in my loader component when I subscribe over than one. 

this is my loader component

```
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, DoCheck, OnChanges, AfterViewInit, OnInit } from '@angular/core';
import { Subject, BehaviorSubject } from 'rxjs';
import { LoaderService } from './loader.service';

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'app-loader',
  templateUrl: './loader.component.html',
  styleUrls: ['./loader.component.scss']

})
export class LoaderComponent implements OnInit {

  isLoading: BehaviorSubject<boolean>=this.loaderService.isLoading;
  constructor(private loaderService: LoaderService, private changeDetector: ChangeDetectorRef) {
  }

  color = 'accent';
  mode = 'indeterminate';
  value = 50;

  ngOnInit(): void {
  }

}

```

and this is my service loader component

```

import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class LoaderService {
  constructor() { }
  isLoading: BehaviorSubject<boolean> = new BehaviorSubject(false);
  count=0;

  show(): void {
    debugger
    console.log(`show`+this.count++)
    this.isLoading.next(true);
  }

  hide(): void {
    debugger
    console.log(`hide`+this.count++)
    this.isLoading.next(false);
  }

}

```

and this is my interceptor loader

```

import { Injectable } from '@angular/core';
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs';
import { finalize } from 'rxjs/operators';
import { LoaderService } from './loader/loader.service';
@Injectable()
export class LoaderInterceptor implements HttpInterceptor {
    constructor(public loaderService: LoaderService) { }
    intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
      this.loaderService.show();
        return next.handle(req).pipe(
            finalize(() => {this.loaderService.hide(); })
        );
}
}

```

my error message is
"

```
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: [object Object]'. Current value: 'ngIf: true'.
    at viewDebugError (core.js:17871)
    at expressionChangedAfterItHasBeenCheckedError (core.js:17859)
    at checkBindingNoChanges (core.js:18059)
    at checkNoChangesNodeInline (core.js:27635)
    at checkNoChangesNode (core.js:27624)
    at debugCheckNoChangesNode (core.js:28228)
    at debugCheckDirectivesFn (core.js:28156)
    at Object.updateDirectives (loader.component.html:2)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:28145)
    at checkNoChangesView ("

```

please help me to solve it.it's my big problem :-(