Trying to call a getter and a setter in my service and getting the error:
Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures 2349
toggleNav(): void {
this.sidebarService.sidebarStatus.pipe(
concatMap((bool: boolean) => this.sidebarService.updateStatus(bool))
);
}
After reading several SO pages about this I have yet to read a simple answer. Can someone explain what this error means in plain Engrish?
Here are the setters and getters:
private _sidebarStatus = new BehaviorSubject<boolean>(true);
public get sidebarStatus(): Observable<boolean> {
return this._sidebarStatus.asObservable();
}
public set updateStatus(bool: boolean) {
this._sidebarStatus.next(bool);
}