TypeDI
Github
Development Version
Development Version
  • Old documentation
  • Getting Started
  • Usage Guide
    • Container API
    • @Service decorator
    • @Inject decorator
    • Service Tokens
    • Inheritance
    • Usage with TypeORM
  • Advanced Usage
    • Creating custom decorators
    • Using scoped container
    • Transient services
  • Usage without TypeScript
    • Getting Started
    • Usage
      • Old documentation
Powered by GitBook
On this page

Was this helpful?

  1. Usage Guide

Usage with TypeORM

To use TypeDI with routing-controllers and/or TypeORM, it's required to configure them to use the top-level TypeDI container used by your application.

import { useContainer as rcUseContainer } from 'routing-controllers';
import { useContainer as typeOrmUseContainer } from 'typeorm';
import { Container } from 'typedi';

rcUseContainer(Container);
typeOrmUseContainer(Container);
PreviousInheritanceNextAdvanced Usage

Last updated 3 years ago

Was this helpful?