Skip to content

Commit 2ce8007

Browse files
author
VladimirAmiorkov
committed
chore(list-view): change the import to be from the base module
chore(list-view): rename the new options API and change its type
1 parent 0e90cc3 commit 2ce8007

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nativescript-angular/directives/dialogs.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ import { AppHostView } from "../app-host-view";
1818
import { DetachedLoader } from "../common/detached-loader";
1919
import { PageFactory, PAGE_FACTORY } from "../platform-providers";
2020
import { once } from "../common/utils";
21-
import { topmost, Frame, ShowModalOptions } from "tns-core-modules/ui/frame";
21+
import { topmost, Frame } from "tns-core-modules/ui/frame";
22+
import { ShowModalOptions } from "tns-core-modules/ui/core/view";
2223

2324
export type BaseShowModalOptions = Pick<ShowModalOptions, Exclude<keyof ShowModalOptions, "closeCallback" | "context">>;
2425

2526
export interface ModalDialogOptions extends BaseShowModalOptions {
2627
context?: any;
2728
viewContainerRef?: ViewContainerRef;
2829
moduleRef?: NgModuleRef<any>;
29-
sourceView?: ElementRef;
30+
target?: View;
3031
}
3132

3233
export class ModalDialogParams {
@@ -62,9 +63,10 @@ export class ModalDialogService {
6263
}
6364

6465
let parentView = options.viewContainerRef.element.nativeElement;
65-
if (options.sourceView) {
66-
parentView = options.sourceView.nativeElement;
66+
if (options.target) {
67+
parentView = options.target;
6768
}
69+
6870
if (parentView instanceof AppHostView && parentView.ngAppRoot) {
6971
parentView = parentView.ngAppRoot;
7072
}

0 commit comments

Comments
 (0)