NavPush

Improve this doc

Directive for declaratively linking to a new page instead of using NavController.push. Similar to ui-router's ui-sref.

Directive

selector: [navPush]

Usage

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

To specify parameters you can use array syntax or the nav-params property:

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

Where pushPage and params are specified in your component, and pushPage contains a reference to a @Page component:

import {LoginPage} from 'login';
@Page({
  template: `<button [navPush]="pushPage" [navParams]="params"></button>`
})
class MyPage {
  constructor(){
    this.pushPage = LoginPage;
    this.params = { id: 42 };
  }
}

Alternate syntax

You can also use syntax similar to Angular2's router, passing an array to NavPush:

<button [navPush]="[pushPage, params]"></button>

Instance Members

registry

Input Properties

Attr Type Details
navPush page

the page you want to push

navParams any

Any parameters you want to pass along

Related

Navigation Component Docs, NavPop API Docs

API

Native

General