From 832692a2389e40a58b15eec11d072638b95d9550 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 05:57:15 +0300 Subject: [PATCH] fix: avoid importing generic type placeholders 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 94841c615a..688d72123a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -69,8 +69,9 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { _interface.properties.forEach(prop => { prop.refs.forEach(ref => { - if (parseNamespace(solution, ref) !== model.namespace) - toBeImported.push({ type: ref, isEnum: types[ref]?.isEnum }); + const propType = types[ref]; + if (propType && parseNamespace(solution, ref) !== model.namespace) + toBeImported.push({ type: ref, isEnum: propType?.isEnum }); }); }); });