import { Directive , HostListener , Input , Optional } from '@angular/core' ; import { NavController } from '../../navigation/nav-controller' ; import { Page } from '../../navigation/nav-util' ; name description usage Component demo see {@link /docs/components#navigation Navigation Component Docs} see {@link ../NavPop NavPop API Docs} @ Directive ( { selector : '[navPush]' } ) export class NavPush { input @ Input ( ) navPush : Page | string ; input @ Input ( ) navParams : { [ k ] : any ; } ; constructor ( @ Optional ( ) public _nav ) { if ( ! _nav ) { console . error ( 'navPush must be within a NavController' ) ; } } hidden @ HostListener ( 'click' ) onClick ( ) { if ( this . _nav && this . navPush ) { this . _nav . push ( this . navPush , this . navParams ) ; return false ; } return true ; } }