From 17999f7047c04e5a0eaae8b59b8979a27cc89187 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 5 Jan 2021 16:46:47 +0200 Subject: [PATCH] fix(material/dialog): use passed in ComponentFactoryResolver to resolve dialog content 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. --- src/material/dialog/dialog.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/material/dialog/dialog.ts b/src/material/dialog/dialog.ts index 1c67e983c716..0aad980a8071 100644 --- a/src/material/dialog/dialog.ts +++ b/src/material/dialog/dialog.ts @@ -330,7 +330,12 @@ export abstract class _MatDialogBase implemen } else { const injector = this._createInjector(config, dialogRef, dialogContainer); const contentRef = dialogContainer.attachComponentPortal( - new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector), + new ComponentPortal( + componentOrTemplateRef, + config.viewContainerRef, + injector, + config.componentFactoryResolver, + ), ); dialogRef.componentInstance = contentRef.instance; }