import { ComponentFactoryResolver , Directive , ElementRef , ErrorHandler , Inject , Input , NgZone , Optional , Renderer , ViewContainerRef , forwardRef } from '@angular/core' ; import { App } from './app' ; import { Config } from '../../config/config' ; import { DeepLinker } from '../../navigation/deep-linker' ; import { DomController } from '../../platform/dom-controller' ; import { GestureController } from '../../gestures/gesture-controller' ; import { NavControllerBase } from '../../navigation/nav-controller-base' ; import { NavigationContainer } from '../../navigation/navigation-container' ; import { Platform } from '../../platform/platform' ; import { TransitionController } from '../../transitions/transition-controller' ; import { ViewController } from '../../navigation/view-controller' ; hidden @ Directive ( { selector : '[overlay-portal]' , } ) export class OverlayPortal extends NavControllerBase implements NavigationContainer { constructor ( @ Inject ( forwardRef ( ( ) => App ) ) app , config , plt , elementRef , zone , renderer , cfr , gestureCtrl , transCtrl , @ Optional ( ) linker , viewPort , domCtrl , errHandler ) { super ( null , app , config , plt , elementRef , zone , renderer , cfr , gestureCtrl , transCtrl , linker , domCtrl , errHandler ) ; this . _isPortal = true ; this . _init = true ; this . setViewport ( viewPort ) ; app . viewDidLeave . subscribe ( ( view ) => { if ( ! view . isOverlay ) { this . dismissPageChangeViews ( ) ; } } ) ; } @ Input ( 'overlay-portal' ) set _overlayPortal ( val ) { this . _zIndexOffset = ( val || 0 ) ; } ngOnDestroy ( ) { this . destroy ( ) ; } getType ( ) { return 'portal' ; } getSecondaryIdentifier ( ) { return null ; } }