mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(segment): adding navigation page for segment for testing toolbar in a toolbar
references #614
This commit is contained in:
@@ -1,19 +1,43 @@
|
||||
import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/common';
|
||||
|
||||
import {App, Page} from 'ionic/ionic';
|
||||
import {Validators, Control, ControlGroup} from 'angular2/common';
|
||||
import {App, Page, NavController} from 'ionic/ionic';
|
||||
|
||||
|
||||
@Page({
|
||||
templateUrl: 'main.html',
|
||||
providers: [FormBuilder],
|
||||
directives: [FORM_DIRECTIVES]
|
||||
})
|
||||
class SegmentPage {
|
||||
constructor(fb: FormBuilder) {
|
||||
constructor(nav: NavController) {
|
||||
this.nav = nav;
|
||||
this.signInType = 'new';
|
||||
}
|
||||
|
||||
goToPage2() {
|
||||
this.nav.push(SegmentPage2);
|
||||
}
|
||||
}
|
||||
|
||||
@Page({
|
||||
template: `
|
||||
<ion-navbar *navbar hideBackButton>
|
||||
<button menuToggle>
|
||||
<icon menu></icon>
|
||||
</button>
|
||||
<ion-title>
|
||||
Second Page
|
||||
</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-content>
|
||||
<h1>Page 2</h1>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
class SegmentPage2 {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@App({
|
||||
pages: [SegmentPage],
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
Segment under Navbar
|
||||
</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="signInType">
|
||||
<ion-segment-button value="new">
|
||||
@@ -22,13 +21,13 @@
|
||||
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<button type="button" block (click)="signInType='new'">New</button>
|
||||
<button block (click)="signInType='new'">New</button>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<button type="button" light block (click)="signInType='existing'">Existing</button>
|
||||
<button light block (click)="signInType='existing'">Existing</button>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<button type="button" dark block (click)="signInType='test'" class="e2eSegmentTestButton">Test</button>
|
||||
<button dark block (click)="signInType='test'" class="e2eSegmentTestButton">Test</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
@@ -44,4 +43,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button block (click)="goToPage2()">Next Page</button>
|
||||
|
||||
</ion-content>
|
||||
|
||||
Reference in New Issue
Block a user