File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change
1
+ import { Container } from 'typedi' ;
2
+ import { ConnectionManager } from 'typeorm' ;
3
+
4
+ /** This file registers all classes from TypeORM in the default TypeDI container. */
5
+
6
+ /**
7
+ * We need to set imported TypeORM classes before requesting them, otherwise we
8
+ * would receive a "ServiceNotFoundError" above TypeDI 0.9.1 from the decorators.
9
+ */
10
+ Container . set ( { id : ConnectionManager , type : ConnectionManager } ) ;
Original file line number Diff line number Diff line change 1
- import { Container as TypeDIContainer } from 'typedi' ;
2
- import { ConnectionManager } from 'typeorm' ;
3
1
import { TypeDIContainerProvider } from './container-provider.class' ;
4
2
5
3
export * from './decorators/inject-connection.decorator' ;
6
4
export * from './decorators/inject-manager.decorator' ;
7
5
export * from './decorators/inject-repository.decorator' ;
8
6
9
- /**
10
- * We need to set imported TypeORM classes before requesting them, otherwise we
11
- * would receive a "ServiceNotFoundError" above TypeDI 0.9.1 from the decorators.
12
- */
13
- TypeDIContainer . set ( { id : ConnectionManager , type : ConnectionManager } ) ;
7
+ import './container-registrations.const' ;
14
8
15
9
/**
16
10
* We export the current container implementation what transforms function
You can’t perform that action at this time.
0 commit comments