title: Angular2 inject a service from AppModule into dependent NgModule's component at runtime?
body: <p>If I have:</p>
  
  <p><code>AppModule
      imports: [SubModule],
      providers: [AppProvidedService]
  </code></p>
  
  <p>and</p>
  
  <p><code>SubModule
      declarations: [SubComponent]
  </code></p>
  
  <p>and</p>
  
  <p><code>SubComponent
      constructor(appProvidedService: AppProvidedService){}
  </code></p>
  
  <p>I get:</p>
  
  <p><code>Uncaught Can't resolve all parameters for SubComponent: (?).</code></p>
  
  <p>Basically, it is saying that AppProvidedService cannot be resolved by the injector.</p>
  
  <p>How do you build an NgModule in such a way as to have it depend on a service that is created in an NgModule that depends on it?</p>
  
  <p>I tried using OpaqueToken and interfaces, but I still have the same issue.  The SubModule just can't see what's coming from a parent module.  </p>
  
  <p>The end desire is to have a module that can take injections from the application that imported it.  That way, I can inject app-specific behavior into common components.</p>