I’m looking to create a module that will look for handlers/models/views inside the module first and then the parent if they don’t exist. I have the handlers part working but can’t seem to get the models to look in the module first.
Here is my ModuleConfig:
`
// Module Properties
this.title = “myModule”;
this.version = “1.0”;
this.entryPoint = ‘myModule’;
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
this.viewParentLookup = false;
// If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa
this.layoutParentLookup = false;
You can’t have automatic overrides of models. WireBox mapping IDs are unique and the last/first one (I think you can choose) to be registered will be used. You can build this behavior though if you want. Manually create a new WireBox instance in your module’s onload and set the “parentInjector” to be the core wirebox instance. Then, instead of using any injection DSL, pass in your custom WireBox injector and if it doesn’t have the model registered, it will ask the parent injector for it. Just like class loaders in Java. Just make sure to change the default application scope registration in WireBox so it doesn’t overwrite the core one.
Not out of the box, but you could always write your own injection namespace DSL. Sound like more work than just swapping your cfproperties with mySpecialWireBox.getInstance().