Skip to content

Commit e1f4ba9

Browse files
authored
fix(material/dialog): use passed in ComponentFactoryResolver to resolve dialog content (#17710)
Currently the `ComponentFactoryResolver` from the dialog config is only used for the dialog container. These changes switch to also use it for the dialog content component. Fixes #17702.
1 parent 37be099 commit e1f4ba9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/material/dialog/dialog.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,12 @@ export abstract class _MatDialogBase<C extends _MatDialogContainerBase> implemen
330330
} else {
331331
const injector = this._createInjector<T>(config, dialogRef, dialogContainer);
332332
const contentRef = dialogContainer.attachComponentPortal<T>(
333-
new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector),
333+
new ComponentPortal(
334+
componentOrTemplateRef,
335+
config.viewContainerRef,
336+
injector,
337+
config.componentFactoryResolver,
338+
),
334339
);
335340
dialogRef.componentInstance = contentRef.instance;
336341
}

0 commit comments

Comments
 (0)