Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
TypeScript interfaces for Dependency Injection #135
In strongly typed languages such as Java or C# we are used to program to an interface.
In TypeScript the interfaces have some interesting features.
The fact that interfaces do not exist in form of IIFE/class as product of TypeScript compilation is the root of problem, how to use it as the DI marker/handle.
More about DI + interfaces vs autowiring with dependencies by class
Therefore I think we need a way how to register which implementation of interface would be injected.
In many DI frameworks people use fluent API of the DI container to configure it. Sample below is Microsoft Unity which uses RTTI of C# generics for the capture.
More about intended usage:
Hope this helps, sorry if I'm not up-to-speed with all details or visions of Angular 2.0 or di component.
Our current thinking is to go with
The syntax for this should already be supported with
Is there an actual Action Item here? I think we already support this so I don't think there is anything to do.
This issue has been automatically locked due to inactivity.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.