Skip to content

Commit

Permalink
fix(material/dialog): use passed in ComponentFactoryResolver to resol…
Browse files Browse the repository at this point in the history
…ve 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.
  • Loading branch information
crisbeto committed Jan 5, 2021
1 parent 71b7b15 commit 23513bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/material/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ export abstract class _MatDialogBase<C extends _MatDialogContainerBase> implemen
} 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 23513bd

Please sign in to comment.