Within the code block below, I am utilizing "rxjs": "~6.2.0"
canActivate():Observable<boolean>
{
return this.auth.user$.pipe
(
switchMap(
user =>
{
return this.userService.get(user.uid);
}
)
).pipe( map( appUser => appUser.isAdmin))
}
The get method within userService contains the following logic.
get(uid : string): AngularFireObject<AppUser>
{
return this.db.object('/users/'+ uid);
}
A specific error is being encountered
"Argument of type '(user: User) => AngularFireObject' is not assignable to parameter of type '(value: User, index: number) => ObservableInput'. Type 'AngularFireObject' is not assignable to type 'ObservableInput'. Type 'AngularFireObject' is not assignable to type 'Iterable'. Property '[Symbol.iterator]' is missing in type 'AngularFireObject'."