I have a BehaviorSubject in a service which expects a LoadingParams
object which has a isLoading
boolean variable on it:
showLoadingSubject = new BehaviourSubject<LoadingParams>(
new LoadingParams(false, 'some text')
);
And I am using it as follows in a component:
showLoading: this.theService.showLoadingSubject.asObservable();
And in the template it is
<div class="loading-screen" *ngIf="showLoading.isLoading | async" #containerDivSuper>
some content in the div
</div>
Then the div should be shown by
this.showloadingSubject.next(new LoadingParams(true, 'somestring'));
But the div does not show up after the next call.
Anyone see what am I doing wrong?