Skip to content

Commit

Permalink
fix: providerWrapper get empty object in component (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurten authored Mar 20, 2021
1 parent b85030a commit 5e46d19
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/context/midwayContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,19 @@ export class MidwayContainer
// 如果是 main,则同步 alias 到所有的 namespace
for (const value of this.configurationMap.values()) {
if (value.namespace !== MAIN_MODULE_KEY) {
super.registerObject(value.namespace + ':' + identifier, target);
const key =
identifier.indexOf(value.namespace + ':') > -1
? identifier
: value.namespace + ':' + identifier;
super.registerObject(key, target);
}
}
} else {
identifier = this.getCurrentNamespace() + ':' + identifier;
const key =
identifier.indexOf(this.getCurrentNamespace() + ':') > -1
? identifier
: this.getCurrentNamespace() + ':' + identifier;
identifier = key;
}
}
return super.registerObject(identifier, target);
Expand Down

0 comments on commit 5e46d19

Please sign in to comment.