title: Resolver Emitting Error ` ERROR Error: "[object Object]" `
body: <p>I'm having a problem with regards of implementing a resolver on my routes as it has no issue until I include <code>InitialDataResolver</code> on my routing module.</p>
  
  <blockquote>
    <p>pages-routing.module.ts</p>
  </blockquote>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  import { FrontComponent } from '../layouts/front/front.component';
  import { HomeComponent } from './home/home.component';
  import { DocsComponent } from './docs/docs.component';
  import { InitialDataResolver } from './../shared/resolvers/initial-data.resolver';
  
  const routes: Routes = [
    {
      path: '',
      component: FrontComponent,
      children: [
        { path: '', component: HomeComponent },
        { path: 'docs', component: DocsComponent }
      ],
      resolve: {
        init: InitialDataResolver
      },
    }
  ];
  
  @NgModule({
    imports: [ RouterModule.forChild(routes) ],
    exports: [ RouterModule ],
    providers: [ InitialDataResolver ]
  })
  export class PagesRoutingModule { }
  </code></pre>
  
  <blockquote>
    <p>initial-data.resolver.ts</p>
  </blockquote>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
  import { Observer } from 'rxjs/Observer';
  import { AppInitService } from '../services/app-init.service';
  import { Observable } from 'rxjs/Observable';
  
  @Injectable()
  export class InitialDataResolver implements Resolve&lt;any&gt; {
  
    constructor(private appInitService: AppInitService) {}
  
    resolve(route: ActivatedRouteSnapshot,
            state: RouterStateSnapshot): Observable&lt;any&gt; {
      return Observable.create((observer: Observer&lt;any&gt;) =&gt; {
  
        this.appInitService.init()
            .subscribe(data =&gt; {
              this.appInitService.preload();
              observer.next(data);
              observer.complete();
            });
  
      });
    }
  
  }
  </code></pre>
  
  <p>The error that I'm encountering is <code>ERROR Error: "[object Object]"</code>. see the snapshot below: 
  <a href="https://i.stack.imgur.com/i1ZFc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/i1ZFc.png" alt="object Object Error"></a></p>