mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(segment): adding a test case for a segment under a nabber
references #614
This commit is contained in:
25
ionic/components/segment/test/nav/index.ts
Normal file
25
ionic/components/segment/test/nav/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/angular2';
|
||||
|
||||
import {App, Page} from 'ionic/ionic';
|
||||
|
||||
|
||||
@Page({
|
||||
templateUrl: 'main.html',
|
||||
providers: [FormBuilder],
|
||||
directives: [FORM_DIRECTIVES]
|
||||
})
|
||||
class SegmentPage {
|
||||
constructor(fb: FormBuilder) {
|
||||
this.relationship = 'enemies';
|
||||
}
|
||||
}
|
||||
|
||||
@App({
|
||||
pages: [SegmentPage],
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
class MyApp {
|
||||
constructor() {
|
||||
this.root = SegmentPage;
|
||||
}
|
||||
}
|
||||
22
ionic/components/segment/test/nav/main.html
Normal file
22
ionic/components/segment/test/nav/main.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<ion-navbar *navbar>
|
||||
<ion-title>
|
||||
Segment under Navbar
|
||||
</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ng-model)]="relationship">
|
||||
<ion-segment-button value="friends" class="e2eSegmentFriends">
|
||||
Friends
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="enemies">
|
||||
Enemies
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
<ion-content padding>
|
||||
<p>Are we friends or enemies? <b>{{ relationship }}</b></p>
|
||||
|
||||
|
||||
</ion-content>
|
||||
Reference in New Issue
Block a user