title: Check if observable is complete
body: <p>I'm trying to authorize user to view certain router path.</p>
  
  <pre><code>canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
  return this.userService.isAdmin() || this.userService.isEmployee()
  }
  </code></pre>
  
  <p>UserService methods are synchronous. UserService is singleton which loads user data from backend. This is not problem when user go through normal flow of application. But when user tries to go directly into guarded path path UserService info may not be loaded in time which results in error</p>
  
  <pre><code>EXCEPTION: Uncaught (in promise): TypeError: Cannot read property 'roleId' of undefined
  TypeError: Cannot read property 'roleId' of undefined
  </code></pre>
  
  <p>This is UserService code </p>
  
  <pre><code>@Injectable()
  export class UserService {
    public $user;
    public loggedUser;
  
    constructor(private loginService: ResourceLoginService) {
      this.$user = this.loginService.get().$observable;
      this.$user.subscribe(response =&gt; {
        this.loggedUser = response;
      });
    }
  
    isAdmin(): boolean {
      return this.loggedUser.roleId === 1;
    }
  </code></pre>
  
  <p>I basically want to subscribe to $user and call methods async if it didn't complete yet or call methods if it has finished in CanActive guard. What is correct way to approach this?</p>