title: APP_INITIALIZER, resolve data during bootstrap
body: <p>I have an Angular 4.3 application, the goal that I am trying to achieve is resolve some data before any content on the page is displayed from bootstrap, and if there is an erorr re-direct to somewhere else, outside the application using location.assign();</p>
  
  <p>I have tried APP_INITIALIZERS however, it does not detect the error message.</p>
  
  <p>My Code:</p>
  
  <pre><code>    pvqFlowInit(): any {
      console.log('4176-21 Calling PVQ FLOW SERVICE!');
      // getData{{ deadLinePassed = true || false, flow = "CREATE || UPDATE", previousScreen = "/RBCXpress || /previousScreen" }}
      let response: PvqResponse = pvqStepUpResponseMerged;
  
      return this._http
          .get('Faked a URL for Error')
          .toPromise()
          .catch(this.handleError);
  }
  
  handleError(error: any) {
      console.log('ERROR OCCURED!');
      location.assign('https://www.google.com');
      console.log('REDIRECT!');
      return error;
  }
  </code></pre>
  
  <p>My AppModule: </p>
  
  <pre><code>providers: [
  PVQ_SERVICES,
  { provide: HTTP_INTERCEPTORS, useClass: HeadersInterceptor, multi: true },
  {
    // Provider for APP_INITIALIZER
    provide: APP_INITIALIZER,
    useFactory: bootstrapPvqService,
    deps: [PVQStepUpService],
    multi: true
  },
  pvqGuards
  ]
  
  export function bootstrapPvqService(pvqStepUpService: PVQStepUpService): 
     Function {
      console.log('Calling SERVICE!!');
      return () =&gt; pvqStepUpService.pvqFlowInit();
  }
  </code></pre>
  
  <p>For what I am trying to achieve, would it be better to just make a call during the bootstrap within main.ts and then pass any resolved data, etc? Or can this be achieved using APP_INITIALIZERS?</p>