Has anyone got inversify to work with this package?
See original GitHub issueJust trying to get useContainer to work with inversify not injecting anything at the moment.
code looks like this:
index.ts
const app: express.Express = express();
useContainer(container);
useExpressServer(app, {
controllers: [__dirname + "/controllers/*.ts"],
});
container.ts
let container = new Container();
container
.bind<IController>(TYPES.ChangelogController)
.to(ChangelogController)
.whenTargetNamed("ChangelogController");
export { container }
Getting errors:
Error: No matching bindings found for serviceIdentifier: ChangelogController
Registered bindings:
ChangelogController - named: ChangelogController
at ActionMetadata.callMethod .../packages/..../src/metadata/ActionMetadata.ts:254:39)
at ..../packages/..../src/RoutingControllers.ts:123:142
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
inversify/InversifyJS - Gitter
Hey guys! I'm trying to write unit tests for a graphql resolver with a dependency on a service using type-graphql, inversify, and jest....
Read more >Inversify cannot inject class with dependencies - Stack Overflow
I 'm a bit pressed on time, so I can't dive further into it for now. However, this should work at least: typescript...
Read more >Dependency injection: setting up InversifyJS IoC for Typescript ...
To implement DI in the project I'm going to use InversifyJS as the IoC (inversion of the control) container. First, we need to...
Read more >Why I Don't Use a DI Container | Node.js w/ TypeScript
Instead of a DI Container, I just package features by component and use logical ... I've been waiting for the moment where my...
Read more >Typescript dependency injection: setting up InversifyJS IoC for ...
Add inversify to the project. To implement DI in the project I'm going to use InversifyJS as the IoC (inversion of the control)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like its solved
Never-mind I got it to work by doing this: