I'm encountering an issue - I've been attempting to retrieve a string that provides a link to the current user's profile picture. However, when I use console.log()
, the output appears as follows:
Console Output:
https://i.sstatic.net/70W6Q.png
Below is my TypeScript code along with the console.log
output:
userImageURL$: Observable<string>;
constructor(
private userService: UserService
) {}
ngOnInit() {
this.userImageURL$ = this.user$.pipe(
switchMap((user: User) => this.userService.getImageURL(user.uid))
);
this.userImageURL$.subscribe((test) => console.log(test));
}
The getImageURL()
function within the UserService
is designed to return a string representing the current user's profile picture.
How can I properly combine these components into a single string?