title: Using downgradeModule in conjunction with downgradeInjectable in an angular / angularjs hybrid application results in error
body: <p>With angular 5.0 the upgrade module now has the option of using downgradeModule which runs angularjs outside of the angular zone. While experimenting with this I have run into a problem with using downgradeInjectable.</p>
  
  <p>I am receiving the error:</p>
  
  <p><em>Uncaught Error: Trying to get the Angular injector before bootstrapping an Angular module.</em></p>
  
  <p><strong>Bootstrapping angular in angular js works fine</strong></p>
  
  <pre><code>import 'zone.js/dist/zone.js';
  import * as angular from 'angular';
  /**
   * Angular bootstrapping
   */
  import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  import { decorateModuleRef } from 'src/environment';
  import { AppModule } from 'src/app/app.module';
  import { downgradeModule } from '@angular/upgrade/static';
  
  export const bootstrapFn = ( extraProviders ) =&gt; {
      const platformRef = platformBrowserDynamic( extraProviders );
      return platformRef
          .bootstrapModule( AppModule )
          .then( decorateModuleRef );
  };
  
  angular.module( 'app.bootstrap', [
      downgradeModule( bootstrapFn ),
  ] );
  </code></pre>
  
  <p><strong>However...</strong></p>
  
  <p>Since the bootstrapping takes place after angularjs has been initialized I can no longer get the downgrade injectable working.</p>
  
  <p><strong>Service to be downgraded</strong></p>
  
  <pre><code>import { Injectable, Inject, OnInit } from '@angular/core';
  
  @Injectable()
  export class MobileService implements OnInit{
      constructor(
          @Inject( 'angularjsDependency1' ) public angularjsDependency1 : any,
          @Inject( 'angularjsDependency2' ) public angularjsDependency2 : any,
      ) {}
  
  }
  </code></pre>
  
  <p><strong>Downgrade injectable attempt</strong></p>
  
  <pre><code>import * as angular from 'angular';
  import { downgradeInjectable } from '@angular/upgrade/static';
  import { MyService } from 'src/services/myService/myService';
  
  export const myServiceDowngraded = angular.module( 'services.mobileService', [
      angularjsDependency1,
      angularjsDependency2,
  ] )
  
  .factory(
      'mobileService',
      downgradeInjectable( MyService ),
  ).name;
  </code></pre>
  
  <p>When "downgradeInjectable( MyService ) runs the angular injector is not available yet since angular hasn't been bootstrapped. Hence the error:</p>
  
  <p><em>Uncaught Error: Trying to get the Angular injector before bootstrapping an Angular module.</em></p>
  
  <p>Does anyone have an idea how I might fix this?</p>