mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
chore(build): fix demo compile errors, tslint errors
fix demo compile errors, tslint errors
This commit is contained in:
53
demos/src/nav-params/AppModule.ts
Normal file
53
demos/src/nav-params/AppModule.ts
Normal file
@ -0,0 +1,53 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicApp, IonicModule, NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
myParam: string = '';
|
||||
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
pushParams() {
|
||||
this.navCtrl.push(PushPage, { 'myParam': this.myParam });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class PushPage {
|
||||
myParam: string;
|
||||
|
||||
constructor(params: NavParams) {
|
||||
this.myParam = params.get('myParam');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage,
|
||||
PushPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
31
demos/src/nav-params/main.html
Normal file
31
demos/src/nav-params/main.html
Normal file
@ -0,0 +1,31 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title>Nav Params</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content>
|
||||
|
||||
<ion-list no-margin>
|
||||
<ion-list-header>
|
||||
Enter Parameters to Pass to the Next Page
|
||||
</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-label>Parameters</ion-label>
|
||||
<ion-select [(ngModel)]="myParam" multiple="true">
|
||||
<ion-option value="Bangkok">Bangkok</ion-option>
|
||||
<ion-option value="Nonthaburi">Nonthaburi</ion-option>
|
||||
<ion-option value="Nakhon Ratchasima">Nakhon Ratchasima</ion-option>
|
||||
<ion-option value="Chiang Mai">Chiang Mai</ion-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
<div padding>
|
||||
<button ion-button color="secondary" block (click)="pushParams()">Navigate with Parameters</button>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
21
demos/src/nav-params/page.html
Normal file
21
demos/src/nav-params/page.html
Normal file
@ -0,0 +1,21 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title>Nav Params</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<div>
|
||||
<h5>Parameters passed:</h5>
|
||||
|
||||
<pre style="background-color: #f8f8f8">selections: [
|
||||
{{myParam}}
|
||||
]</pre>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
Reference in New Issue
Block a user