Module Injection Shortcut when the inject annotation is @moduleAdress
Description
This PR adds the ability to use an id injection with a module. Just as the id DSL uses the name of the model as the mapping, this adds a similar DSL for modules using @#moduleNamespace#.
property name="MyService" inject="id"; // should inject the dependency mapped to `MyService`
property name="MyService" inject="@myModule"; // should inject the dependency mapped to `MyService@myModule`
This also removes the old (beta) behavior of registering a default export in the ModuleService. The good news is this will still work as long as the name being injected is the name of the module.
property name="bcrypt" inject="@Bcrypt"; // This works because the model name in Bcrypt is `Bcrypt`
property name="encrypt" inject="@Bcrypt"; // This will not work anymore because `encrypt@Bcrypt` isn't a valid mapping
Gliffy Diagrams
Activity
Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.
This PR adds the ability to use an id injection with a module.
Just as the id DSL uses the name of the model as the mapping,
this adds a similar DSL for modules using @#moduleNamespace#.
property name="MyService" inject="id";
// should inject the dependency mapped to `MyService`
property name="MyService" inject="@myModule";
// should inject the dependency mapped to `MyService@myModule`
This also removes the old (beta) behavior of registering a default export in the ModuleService.
The good news is this will still work as long as the name being injected is the name of the module.
property name="bcrypt" inject="@Bcrypt";
// This works because the model name in Bcrypt is `Bcrypt`
property name="encrypt" inject="@Bcrypt";
// This will not work anymore because `encrypt@Bcrypt` isn't a valid mapping