diff --git a/app/angular/src/client/preview/angular/helpers.ts b/app/angular/src/client/preview/angular/helpers.ts index 71cc939b4189..b5cae7d483a0 100644 --- a/app/angular/src/client/preview/angular/helpers.ts +++ b/app/angular/src/client/preview/angular/helpers.ts @@ -59,6 +59,7 @@ const getComponentMetadata = ({ schemas: [], declarations: [], providers: [], + entryComponents: [], }, }: NgStory) => { if (!component || typeof component !== 'function') { @@ -73,7 +74,7 @@ const getComponentMetadata = ({ (propsMetadata)[key] = (propsMeta)[key]; }); - const { imports = [], schemas = [], declarations = [], providers = [] } = moduleMetadata; + const { imports = [], schemas = [], declarations = [], providers = [], entryComponents = [] } = moduleMetadata; return { component, @@ -86,6 +87,7 @@ const getComponentMetadata = ({ schemas, declarations, providers, + entryComponents, }, }; }; @@ -118,13 +120,14 @@ const getModule = ( schemas: [], declarations: [], providers: [], + entryComponents: [], } ): IModule => { const moduleMeta = new NgModule({ declarations: [...declarations, ...moduleMetadata.declarations], imports: [BrowserModule, FormsModule, ...moduleMetadata.imports], providers: [{ provide: STORY, useValue: Object.assign({}, data) }, ...moduleMetadata.providers], - entryComponents: [...entryComponents], + entryComponents: [...entryComponents, ...moduleMetadata.entryComponents], schemas: [...moduleMetadata.schemas], bootstrap: [...bootstrap], }); diff --git a/app/angular/src/client/preview/angular/types.ts b/app/angular/src/client/preview/angular/types.ts index d77d4284a9f4..c69ec8c6d863 100644 --- a/app/angular/src/client/preview/angular/types.ts +++ b/app/angular/src/client/preview/angular/types.ts @@ -3,6 +3,7 @@ export interface NgModuleMetadata { imports: Array; schemas: Array; providers: Array; + entryComponents: Array; } export interface ICollection {