Skip to content

Commit

Permalink
Fixed missing ngModuleRef
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Oswald (OSP) committed Jan 17, 2024
1 parent d8ec6f1 commit 71a42b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export class PlaceholderComponent implements OnInit, OnChanges, DoCheck, OnDestr
// work-around for https://github.com/angular/angular/issues/12215
const createdComponentRef = this.view.createComponent(rendering.componentImplementation, {
index: index,
ngModuleRef: rendering.componentModuleRef,
});
if (this.parentStyleAttribute) {
this.renderer.setAttribute(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Inject, Injectable, Injector, Type, createNgModule } from '@angular/core';
import { createNgModule, Inject, Injectable, Injector, NgModuleRef, Type } from '@angular/core';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';
import {
ComponentNameAndModule,
Expand All @@ -17,6 +17,7 @@ export interface ComponentFactoryResult {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
componentImplementation?: Type<any>;
componentDefinition: ComponentRendering | HtmlElementRendering;
componentModuleRef?: NgModuleRef<unknown>;
canActivate?:
| JssCanActivate
| Type<JssCanActivate>
Expand Down Expand Up @@ -86,6 +87,7 @@ export class JssComponentFactoryService {
return {
componentDefinition: component,
componentImplementation: componentType,
componentModuleRef: moduleRef,
canActivate: lazyComponent.canActivate,
resolve: lazyComponent.resolve,
};
Expand Down

0 comments on commit 71a42b1

Please sign in to comment.