@@ -11,7 +11,6 @@ import {DomPortalOutlet} from '@angular/cdk/portal';
1111import { DOCUMENT , Location } from '@angular/common' ;
1212import {
1313 ApplicationRef ,
14- ComponentFactoryResolver ,
1514 Injectable ,
1615 Injector ,
1716 NgZone ,
@@ -31,9 +30,6 @@ import {ScrollStrategyOptions} from './scroll/index';
3130/** Next overlay unique ID. */
3231let nextUniqueId = 0 ;
3332
34- // Note that Overlay is *not* scoped to the app root because of the ComponentFactoryResolver
35- // which needs to be different depending on where OverlayModule is imported.
36-
3733/**
3834 * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
3935 * used as a low-level building block for other components. Dialogs, tooltips, menus,
@@ -46,7 +42,6 @@ let nextUniqueId = 0;
4642export class Overlay {
4743 scrollStrategies = inject ( ScrollStrategyOptions ) ;
4844 private _overlayContainer = inject ( OverlayContainer ) ;
49- private _componentFactoryResolver = inject ( ComponentFactoryResolver ) ;
5045 private _positionBuilder = inject ( OverlayPositionBuilder ) ;
5146 private _keyboardDispatcher = inject ( OverlayKeyboardDispatcher ) ;
5247 private _injector = inject ( Injector ) ;
@@ -141,12 +136,6 @@ export class Overlay {
141136 this . _appRef = this . _injector . get < ApplicationRef > ( ApplicationRef ) ;
142137 }
143138
144- return new DomPortalOutlet (
145- pane ,
146- this . _componentFactoryResolver ,
147- this . _appRef ,
148- this . _injector ,
149- this . _document ,
150- ) ;
139+ return new DomPortalOutlet ( pane , null , this . _appRef , this . _injector , this . _document ) ;
151140 }
152141}
0 commit comments