docs(demos): nav param demo

This commit is contained in:
Drew Rygh
2015-12-08 11:20:56 -06:00
parent a27a9a2a39
commit 4f9a639b05
4 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,2 @@
<ion-nav id="nav" [root]="rootPage" #content></ion-nav>
<ion-overlay></ion-overlay>

41
demos/nav-params/index.ts Normal file
View File

@ -0,0 +1,41 @@
import {App, Page, IonicApp, Config, Platform} from 'ionic/ionic';
import {NavController, NavParams} from 'ionic/ionic';
@App({
templateUrl: 'app.html'
})
class ApiDemoApp {
constructor() {
this.rootPage = InitialPage;
}
}
@Page({
templateUrl: 'main.html'
})
export class InitialPage {
constructor(nav: NavController) {
this.nav = nav;
this.myParam = '';
}
pushParams() {
this.nav.push(Page2, { 'myParam': this.myParam });
}
}
@Page({
templateUrl: "page-2.html"
})
export class Page2 {
constructor(
nav: NavController,
params: NavParams
) {
this.nav = nav;
this.myParam = params.get('myParam');
}
}

View File

@ -0,0 +1,14 @@
<ion-navbar *navbar>
<ion-title>Nav Params</ion-title>
</ion-navbar>
<ion-content padding>
<ion-row>
<ion-input style="width: 100%">
<input type="text" placeholder="Params" [(ng-model)]="myParam">
</ion-input>
</ion-row>
<ion-row>
<button secondary full block (click)="pushParams()">Push Params</button>
</ion-row>
<ion-content>

View File

@ -0,0 +1,7 @@
<ion-navbar *navbar>
<ion-title>Modals</ion-title>
</ion-navbar>
<ion-content padding>
<div>Parameters entered: {{myParam}}</div>
</ion-content>