title: Angular 5/6 Resolver and Observable
body: <p>I'm literally going crazy trying to use a Resolver in Angular 6.</p>
  
  <p>My Resolver, working version:</p>
  
  <pre><code>    @Injectable()
  export class MyResolver implements Resolve&lt;boolean&gt; {
      constructor() {
      }
  
      resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable&lt;boolean&gt; | Promise&lt;boolean&gt; | boolean {
          return true;
      }
  </code></pre>
  
  <p>I inject it like this in my routing:</p>
  
  <pre><code>path: "secure",
      component: SecureComponent,
      canActivate: [AuthGuard],
      canActivateChild: [AuthGuard],
      resolve: {
          myValue: MyResolver
      }
  </code></pre>
  
  <p>This works properly, the component constructor is fired and I can retrieve the myValue from the route.</p>
  
  <p>But as soon as I change my resolver to:</p>
  
  <pre><code>return Observable.create(true);
  </code></pre>
  
  <p>Or any code that returns an Observable instead of a plain value the constructor of the component isn't fired anymore, and I get a blank page at my route. The resolver code still runs in its entirety.</p>
  
  <p>I verified the constructor not being fired by placing a console.log("foo") at the very first line of the constructor, and it is not called.</p>
  
  <p>So I can't understand why I can't output an observable from my resolver. The whole point of the resolvers is to resolve deferred values (thus returning observables).</p>
  
  <p>What am I doing wrong?</p>