import { ViewContainerRef } from '@angular/core' ; import { DialogRef , DROP_IN_TYPE , OverlayConfig } from 'ngx-modialog' ; import { Modal } from '../modal' ; import { JSNativeModalContext , JSNativeModalContextBuilder } from '../modal-context' ; import { JSNativeModalRenderer } from '../js-native-modal-renderer' ; export class JSNativePresetBuilder extends JSNativeModalContextBuilder < JSNativeModalContext > { constructor ( modal , dialogType ) { super ( < any > { modal , dialogType } ) ; } param viewContainer open ( viewContainer ? ) { let context = this . toJSON ( ) ; if ( ! ( context . modal instanceof Modal ) ) { return < any > Promise . reject ( new Error ( 'Configuration Error: modal service not set.' ) ) ; } this . $$beforeOpen ( context ) ; let overlayConfig = { context : context , renderer : new JSNativeModalRenderer ( ) , viewContainer : viewContainer } ; return context . modal . open ( context . component , overlayConfig ) ; } }