Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

NavPush

[navPush]

Improve this doc

Directive to declaratively push a new page to the current nav stack.

Usage

<button ion-button [navPush]="pushPage"></button>

To specify parameters you can use array syntax or the navParams property:

<button ion-button [navPush]="pushPage" [navParams]="params">Go</button>

Where pushPage and params are specified in your component, and pushPage contains a reference to a component you would like to push:

import { LoginPage } from './login';

@Component({
  template: `<button ion-button [navPush]="pushPage" [navParams]="params">Go</button>`
})
class MyPage {
  params: Object;
  pushPage: any;
  constructor(){
    this.pushPage = LoginPage;
    this.params = { id: 42 };
  }
}

Input Properties

Attr Type Details
navParams any

Any NavParams you want to pass along to the next view.

navPush Page | string

The component class or deeplink name you want to push onto the navigation stack.

Related

Navigation Component Docs, NavPop API Docs

API

Native

General