Skip to content

Commit

Permalink
fix: inject definition bug (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 authored Mar 1, 2021
1 parent b4b84ef commit e11a057
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/decorator/src/common/decoratorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,11 @@ export function savePropertyInject(opts: InjectOptions) {
let identifier = opts.identifier;
if (!identifier) {
const type = getPropertyType(opts.target, opts.targetKey);
if (!type.isBaseType && isClass(type.originDesign)) {
if (
!type.isBaseType &&
isClass(type.originDesign) &&
isProvide(type.originDesign)
) {
identifier = getProviderId(type.originDesign);
}
if (!identifier) {
Expand Down
2 changes: 1 addition & 1 deletion packages/decorator/test/annotation/inject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('/test/annotation/inject.test.ts', () => {
ff: [
{
'key': 'inject',
'value': 'injectChild2'
'value': 'ff'
}
]
});
Expand Down

0 comments on commit e11a057

Please sign in to comment.