@kithinji/orca 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.iife.js +10 -2
- package/dist/browser/index.iife.js.map +2 -2
- package/dist/browser/index.mjs +10 -2
- package/dist/browser/index.mjs.map +2 -2
- package/dist/node/index.cjs +9 -1
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.mjs +9 -1
- package/dist/node/index.mjs.map +2 -2
- package/dist/types/browser/dom/dom.d.ts.map +1 -1
- package/dist/types/shared/dom/osc.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -2867,6 +2867,7 @@ var OSC = class {
|
|
|
2867
2867
|
const module = await import(path);
|
|
2868
2868
|
const ComponentClass = module[name];
|
|
2869
2869
|
const params = Reflect.getMetadata(DESIGN_PARAMTYPES, ComponentClass) || [];
|
|
2870
|
+
const deps = Reflect.getMetadata(COMPONENT_DEPS, ComponentClass) || [];
|
|
2870
2871
|
const injector = getCurrentInjector();
|
|
2871
2872
|
if (injector == null) {
|
|
2872
2873
|
throw new Error(`Couldn't find an injector`);
|
|
@@ -2879,7 +2880,14 @@ var OSC = class {
|
|
|
2879
2880
|
useClass: ComponentClass,
|
|
2880
2881
|
scope: "transient"
|
|
2881
2882
|
});
|
|
2882
|
-
|
|
2883
|
+
deps.forEach(
|
|
2884
|
+
(depClass) => injector.addProvider({
|
|
2885
|
+
provide: depClass,
|
|
2886
|
+
useClass: depClass,
|
|
2887
|
+
scope: "transient"
|
|
2888
|
+
})
|
|
2889
|
+
);
|
|
2890
|
+
params.forEach((p) => injector.addProvider(p));
|
|
2883
2891
|
const cleanProps = { ...props };
|
|
2884
2892
|
delete cleanProps.__clientComponent;
|
|
2885
2893
|
const componentInstance = injector.resolve(ComponentClass);
|
|
@@ -3070,7 +3078,7 @@ function autoCleanup(element, callback) {
|
|
|
3070
3078
|
}, 0);
|
|
3071
3079
|
}
|
|
3072
3080
|
function createComponent(ComponentClass, props = {}, parentComponent) {
|
|
3073
|
-
let injector =
|
|
3081
|
+
let injector = getCurrentInjector();
|
|
3074
3082
|
if (!injector) {
|
|
3075
3083
|
throw new Error(`Cannot create component ${ComponentClass.name} outside injection context. No injector available from current context or parent component.`);
|
|
3076
3084
|
}
|