Skip to content

Commit 96d898d

Browse files
authored
Merge pull request #32 from gjdass/troubleshooting-in-readme
Add troubleshooting section to README
2 parents cd3daf9 + 44fb018 commit 96d898d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,23 @@ export class UserRepository {
456456

457457
If you need to remove registered service from container simply use `Container.remove(...)` method.
458458
Also you can completely reset the container by calling `Container.reset()` method.
459-
This will effectively remove all registered services from the container.
459+
This will effectively remove all registered services from the container.
460+
461+
## Troubleshooting
462+
463+
### Use TypeDI with routing-controllers and/or TypeORM
464+
465+
In order to use typedi with routing-controllers and/or typeorm, it's **necessary** to tell these libs to use the typedi container.
466+
Otherwise you may face [this kind of issue](https://github.com/pleerock/typedi/issues/4).
467+
468+
```Typescript
469+
import { useContainer as routingUseContainer } from 'routing-controllers';
470+
import { useContainer as ormUseContainer } from 'typeorm';
471+
import { Container } from "typedi";
472+
473+
routingUseContainer(Container);
474+
ormUseContainer(Container);
475+
```
460476

461477
## Samples
462478

0 commit comments

Comments
 (0)