I have a service that has some asynchronous stuff to do, how can I postpone a data binding render until the service has done its asynchronous work?
this.sessionService.onSessionChange().subscribe(function(session) {
console.log(session);
self.user = session.user;
});
Service:
onSessionChange(): Observable<Session> {
return this.sessionObservable.asObservable();
}
The user is undefined because the session isn't ready yet:
<h4>Hi {{user.name}}.</h4>
How can I use a pipe with my onSessionChange observable?