title: Inject service of parent module in NestJS
body: <p>I have three Modules in NestJS: <code>EndpointModule</code>, <code>JWTModule</code> and the specific Endpoints as Modules (for Example <code>InfoModule</code>)</p>
  
  <p>My EndpointModule looks like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Module({
      imports: [
          JWTModule.withRSAKeys(
              Path.resolveByApp('./private.key'),
              Path.resolveByApp('./public.key')
          ),
          InfoModule,
          //More Endpoints
      ],
      exports: [JWTModule]
  })
  export class EndpointModule {}
  </code></pre>
  
  <p>JWTModule like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Module({
      providers: [JWTService],
      exports: [JWTService]
  })
  export class JWTModule {
      static async withRSAKeys(
          privateKeyPath: string,
          publicKeyPath: string
      ): Promise&lt;DynamicModule&gt; {
          return {
              module: JWTModule,
              providers: await this.createProviders(privateKeyPath, publicKeyPath)
          };
      }
  </code></pre>
  
  <p>As you can see <code>JWTModule</code> is a dynamic module. Now i want to inject the exported <code>JWTService</code> in my endpoint controllers. For Example:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Module({
      controllers: [InfoController]
  })
  export class InfoModule {}
  
  @Controller()
  export class InfoController {
      constructor(private jwt: JWTService){};
  </code></pre>
  
  <p>This does not work. I have to import the <code>EndpointModule</code> in my <code>InfoModule</code> but this creates a circular dependency. Are there any ways to avoid this? Should i reorder my Modules?</p>