I have been getting the following error message when trying to apply the switchMap operator to my Observable:
Property 'switchMap' does not exist on type 'Observable'.
I'm currently using rxjs version 5.5.2, and in my component, I have it imported like so:
import 'rxjs/operator/switchMap';
However, I still get a compilation error. I have looked at similar questions and have not found a proper solution to this, any suggestions on what could be the issue here?
get appUser$() : Observable<AppUser> {
return this.user$
.switchMap(user => {
if (user) return this.userService.get(user.uid);
return Observable.of(null);
});
}