mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
64
src/components/nav/test/nav-push-pop/app-module.ts
Normal file
64
src/components/nav/test/nav-push-pop/app-module.ts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import { Component, NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
import { IonicApp, IonicModule, NavParams } from '../../../..';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: `
|
||||||
|
<ion-header>
|
||||||
|
<ion-navbar>
|
||||||
|
<ion-title>Second Page</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content padding>{{msg}}</ion-content>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class SecondPage {
|
||||||
|
msg: string = '';
|
||||||
|
constructor(params: NavParams) {
|
||||||
|
this.msg = params.get('msg');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
export class E2EPage {
|
||||||
|
pushPage: any = SecondPage;
|
||||||
|
visible: boolean = false;
|
||||||
|
|
||||||
|
ionViewDidEnter() {
|
||||||
|
this.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: '<ion-nav [root]="root"></ion-nav>'
|
||||||
|
})
|
||||||
|
export class E2EApp {
|
||||||
|
root = E2EPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage,
|
||||||
|
SecondPage
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
IonicModule.forRoot(E2EApp)
|
||||||
|
],
|
||||||
|
bootstrap: [IonicApp],
|
||||||
|
entryComponents: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage,
|
||||||
|
SecondPage
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppModule {}
|
||||||
|
|
121
src/components/nav/test/nav-push-pop/main.html
Normal file
121
src/components/nav/test/nav-push-pop/main.html
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
<ion-header>
|
||||||
|
|
||||||
|
<ion-navbar>
|
||||||
|
<ion-title>navPush use cases</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Is visible: {{visible}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<button ion-button
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'button (always visible)'}">button (always visible)</button>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p *ngIf="visible">
|
||||||
|
<button ion-button
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'button (p *ngIf=visible)'}">button (p *ngIf="visible")</button>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<button ion-button
|
||||||
|
*ngIf="visible"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'button (button *ngIf=visible)'}">button (button *ngIf="visible")</button>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p *ngIf="!visible">
|
||||||
|
<button ion-button color="danger"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'button (p *ngIf=!visible)'}">button (p *ngIf="!visible")</button>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<button ion-button color="danger"
|
||||||
|
*ngIf="!visible"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'button (button *ngIf=!visible)'}">button (button *ngIf="!visible")</button>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ion-list>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Toggle Visible</ion-label>
|
||||||
|
<ion-toggle [(ngModel)]="visible"></ion-toggle>
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a ion-button
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (always visible)'}">a (always visible)</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p *ngIf="visible">
|
||||||
|
<a ion-button
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (p *ngIf=visible)'}">a (p *ngIf="visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a ion-button
|
||||||
|
*ngIf="visible"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (a *ngIf=visible)'}">a (a *ngIf="visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p *ngIf="!visible">
|
||||||
|
<a ion-button color="danger"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (p *ngIf=!visible)'}">a (p *ngIf="!visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a ion-button color="danger"
|
||||||
|
*ngIf="!visible"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (a *ngIf=!visible)'}">a (a *ngIf="!visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
NO ion-button
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (always visible)'}">a (always visible)</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p *ngIf="visible">
|
||||||
|
<a
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (p *ngIf=visible)'}">a (p *ngIf="visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a
|
||||||
|
*ngIf="visible"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (a *ngIf=visible)'}">a (a *ngIf="visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p *ngIf="!visible">
|
||||||
|
<a color="danger"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (p *ngIf=!visible)'}">a (p *ngIf="!visible")</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a color="danger"
|
||||||
|
*ngIf="!visible"
|
||||||
|
[navPush]="pushPage"
|
||||||
|
[navParams]="{msg:'a (a *ngIf=!visible)'}">a (a *ngIf="!visible")</a>
|
||||||
|
</p>
|
||||||
|
</ion-content>
|
Reference in New Issue
Block a user