title: return boolean instead of subscribe to canActivate
body: <p>I have a component protected with canActivate guard. The Authguard in the <code>checkLogin</code> function subscribes from an observable but I do not know how to return a boolean value from it to canActivate. </p>
  
  <p><strong>guard.service.ts</strong></p>
  
  <pre><code>canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
      let url: string = state.url;
  
      return this.checkLogin(url);
    }
  
      public checkService:boolean;
    checkLogin(url: string):boolean {
  
           return this.loadAppSettings().subscribe(res=&gt;{
                console.log(this.checkservice);
                if (this.checkservice == true) 
                {
                     return true; 
              }
              else{
                  this.router.navigate(['/error-user']);
                  return false;
              }
              });
        }//checkLogin throws error as type subscription is not assignable to type boolean
  </code></pre>
  
  <p>So what I want is if the <code>this.checkService</code> is true it should just return true and the user should be able to land on the guarded route but if it is false he should be navigated to <code>error-user</code>. </p>
  
  <p><a href="https://stackoverflow.com/questions/39772181/angular2-return-boolean-with-subscribe-to-canactivate">Angular2 - return boolean with subscribe to canActivate</a> this question is similar to mine but couldn't resolve my issue with it.</p>
  
  <p>Can somebody help here.</p>