Skip to content

Commit 0768819

Browse files
committed
feat(overlay): change type of moduleRef param in attache method, #5798
1 parent cb16744 commit 0768819

File tree

1 file changed

+7
-4
lines changed
  • projects/igniteui-angular/src/lib/services/overlay

1 file changed

+7
-4
lines changed

projects/igniteui-angular/src/lib/services/overlay/overlay.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,14 @@ export class IgxOverlayService implements OnDestroy {
123123
* Generates Id. Provide this Id when call `show(id, settings?)` method
124124
* @param component Component Type to show in overlay
125125
* @param settings Display settings for the overlay, such as positioning and scroll/close behavior.
126-
* @param moduleRef Optional reference to the NgModule that can resolve the component's factory
126+
* @param moduleRef Optional reference to an object containing Injector and ComponentFactoryResolver
127+
* that can resolve the component's factory
127128
* @returns Id of the created overlay. Valid until `onClosed` is emitted.
128129
*/
129-
attach(component: Type<any>, settings?: OverlaySettings, moduleRef?: NgModuleRef<any>): string;
130-
attach(component: ElementRef | Type<any>, settings?: OverlaySettings, moduleRef?: NgModuleRef<any>): string {
130+
attach(component: Type<any>, settings?: OverlaySettings,
131+
moduleRef?: Pick<NgModuleRef<any>, 'injector' | 'componentFactoryResolver'>): string;
132+
attach(component: ElementRef | Type<any>, settings?: OverlaySettings,
133+
moduleRef?: Pick<NgModuleRef<any>, 'injector' | 'componentFactoryResolver'>): string {
131134
let info: OverlayInfo;
132135
info = this.getOverlayInfo(component, moduleRef);
133136

@@ -330,7 +333,7 @@ export class IgxOverlayService implements OnDestroy {
330333
}
331334
}
332335

333-
private getOverlayInfo(component: any, moduleRef?: NgModuleRef<any>): OverlayInfo {
336+
private getOverlayInfo(component: any, moduleRef?: Pick<NgModuleRef<any>, 'injector' | 'componentFactoryResolver'>): OverlayInfo {
334337
const info: OverlayInfo = { ngZone: this._zone };
335338
if (component instanceof ElementRef) {
336339
info.elementRef = <ElementRef>component;

0 commit comments

Comments
 (0)