In my Angular (4+) application, I want to create a basic plugin mechanism:
- The extension point is defined as an interface
- Extensions implement that interface
- To find all extensions, I need to discover the implementations of that interface at runtime.
Example: interface SearchStrategy
with implementations PersonSearchStrategy
and DocumentSearchStrategy
(both services, registered as providers).
Is there a way to dynamically get instances of these services by querying for implementations of the SearchStrategy
interface? How?
(might be some Injector related functionality?)