Skip to content

Commit

Permalink
fix(dialog): use passed in ComponentFactoryResolver to resolve dialog…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
crisbeto committed Dec 15, 2019
1 parent 527f1b5 commit 0d4323e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/material/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ export class MatDialog implements OnDestroy {

// Create a reference to the dialog we're creating in order to give the user a handle
// to modify and close it.
const dialogRef =
new MatDialogRef<T, R>(overlayRef, dialogContainer, config.id);
const dialogRef = new MatDialogRef<T, R>(overlayRef, dialogContainer, config.id);

// When the dialog backdrop is clicked, we want to close it.
if (config.hasBackdrop) {
Expand All @@ -261,7 +260,8 @@ export class MatDialog implements OnDestroy {
} else {
const injector = this._createInjector<T>(config, dialogRef, dialogContainer);
const contentRef = dialogContainer.attachComponentPortal<T>(
new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector));
new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector,
config.componentFactoryResolver));
dialogRef.componentInstance = contentRef.instance;
}

Expand Down

0 comments on commit 0d4323e

Please sign in to comment.