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 angular#17702.
  • Loading branch information
crisbeto committed Mar 1, 2022
1 parent 6c7cc8a commit 17999f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/material/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ 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 17999f7

Please sign in to comment.