diff --git a/nativescript-angular/directives/dialogs.ts b/nativescript-angular/directives/dialogs.ts index fcbe436f6..6dc804a90 100644 --- a/nativescript-angular/directives/dialogs.ts +++ b/nativescript-angular/directives/dialogs.ts @@ -20,6 +20,8 @@ import { PageFactory, PAGE_FACTORY } from "../platform-providers"; export interface ModalDialogOptions { context?: any; fullscreen?: boolean; + animated?: boolean; + stretched?: boolean; viewContainerRef?: ViewContainerRef; moduleRef?: NgModuleRef; } @@ -36,6 +38,8 @@ interface ShowDialogOptions { context: any; doneCallback; fullscreen: boolean; + animated: boolean; + stretched: boolean; pageFactory: PageFactory; parentView: ViewBase; resolver: ComponentFactoryResolver; @@ -48,7 +52,7 @@ export class ModalDialogService { } public showModal(type: Type, - { viewContainerRef, moduleRef, context, fullscreen }: ModalDialogOptions + { viewContainerRef, moduleRef, context, fullscreen, animated, stretched }: ModalDialogOptions ): Promise { if (!viewContainerRef) { throw new Error( @@ -77,6 +81,8 @@ export class ModalDialogService { context, doneCallback: resolve, fullscreen, + animated, + stretched, pageFactory, parentView, resolver, @@ -90,6 +96,8 @@ export class ModalDialogService { context, doneCallback, fullscreen, + animated, + stretched, pageFactory, parentView, resolver, @@ -132,7 +140,9 @@ export class ModalDialogService { (componentView.parent).removeChild(componentView); } - parentView.showModal(componentView, context, closeCallback, fullscreen); + // TODO: remove cast after https://github.com/NativeScript/NativeScript/pull/5734 + // is in a published version of tns-core-modules. + (parentView).showModal(componentView, context, closeCallback, fullscreen, animated, stretched); }); } } diff --git a/ng-sample/app/examples/modal/modal-test.ts b/ng-sample/app/examples/modal/modal-test.ts index 5bc742b10..b4b9279ab 100644 --- a/ng-sample/app/examples/modal/modal-test.ts +++ b/ng-sample/app/examples/modal/modal-test.ts @@ -9,6 +9,8 @@ import { ModalContent } from "./modal-content"; + + @@ -33,10 +35,12 @@ export class ModalTest { static exports = []; - public showModal(fullscreen: boolean) { + public showModal(fullscreen: boolean, animated = true, stretched = false) { const options: ModalDialogOptions = { context: { promptMsg: "This is the prompt message!" }, - fullscreen: fullscreen, + fullscreen, + animated, + stretched, viewContainerRef: this.vcRef };