
\begin{figure}[H]
  \begin{lstlisting}[style=JavaScript]
  export abstract class IChildService {
    // ...
  }

  @Injectable(IChildService)
  export class ChildService implements IChildService {
    // ...
  }

  @Injectable()
  export class ParentService {
    private childService: IChildService;

    constructor(
      childService: IChildService
    ) {
      this.childService = IChildService;
    }

    // ...
  }

  @Module({
    providers: [
      ChildService,
      ParentService
    ],
    exports: [
      ParentService
    ]
  })
  export class ParentModule {}
  \end{lstlisting}

  \centering
  \includegraphics{nestjs1}
  \caption{Exemple d'injection de dépendances avec NestJS}
  \label{nestjs1}
\end{figure}
