From a1ae2d9973ae90b3c72e3cae04e6f1f0bb341df8 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:10:55 +0300 Subject: [PATCH] fix: remove condition blocking enum generation in schematics --- npm/ng-packs/packages/schematics/src/utils/model.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 688d72123a..04eea19524 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -70,8 +70,9 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { _interface.properties.forEach(prop => { prop.refs.forEach(ref => { const propType = types[ref]; - if (propType && parseNamespace(solution, ref) !== model.namespace) - toBeImported.push({ type: ref, isEnum: propType?.isEnum }); + if (propType?.isEnum) toBeImported.push({ type: ref, isEnum: true }); + else if (parseNamespace(solution, ref) !== model.namespace) + toBeImported.push({ type: ref, isEnum: false }); }); }); });