mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
make e2e build faster
This commit is contained in:
2
ionic/components/nav/test/basic/main.html
Normal file
2
ionic/components/nav/test/basic/main.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<ion-nav [initial-component]="initial">
|
||||
</ion-nav>
|
||||
18
ionic/components/nav/test/basic/main.js
Normal file
18
ionic/components/nav/test/basic/main.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import {Component, View as NgView, bootstrap} from 'angular2/angular2'
|
||||
import {Nav} from 'ionic/components/nav/nav'
|
||||
import {Log} from 'ionic/util'
|
||||
import {FirstPage} from 'pages/first-page'
|
||||
|
||||
@Component({ selector: '[ion-app]' })
|
||||
@NgView({
|
||||
directives: [Nav],
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class IonicApp {
|
||||
constructor() {
|
||||
this.initial = FirstPage
|
||||
console.log('IonicApp Start')
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap(IonicApp)
|
||||
3
ionic/components/nav/test/basic/pages/first-page.html
Normal file
3
ionic/components/nav/test/basic/pages/first-page.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<ion-view nav-title="First Page">
|
||||
<button (click)="nextPage()">Push Page 2</button>
|
||||
</ion-view>
|
||||
22
ionic/components/nav/test/basic/pages/first-page.js
Normal file
22
ionic/components/nav/test/basic/pages/first-page.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import {Component, View as NgView, Parent} from 'angular2/angular2'
|
||||
import {Nav, View} from 'ionic/ionic'
|
||||
import {SecondPage} from 'pages/second-page'
|
||||
|
||||
@Component({
|
||||
selector: 'first-page'
|
||||
})
|
||||
@NgView({
|
||||
templateUrl: 'pages/first-page.html',
|
||||
directives: [View]
|
||||
})
|
||||
export class FirstPage {
|
||||
constructor(
|
||||
@Parent() viewport: Nav
|
||||
) {
|
||||
this.viewport = viewport
|
||||
}
|
||||
|
||||
nextPage() {
|
||||
this.viewport.push(SecondPage)
|
||||
}
|
||||
}
|
||||
3
ionic/components/nav/test/basic/pages/second-page.html
Normal file
3
ionic/components/nav/test/basic/pages/second-page.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<ion-view nav-title="Second Page">
|
||||
<button (click)="pop()">Pop (Go back)</button>
|
||||
</ion-view>
|
||||
21
ionic/components/nav/test/basic/pages/second-page.js
Normal file
21
ionic/components/nav/test/basic/pages/second-page.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import {Component, View as NgView, Parent} from 'angular2/angular2'
|
||||
import {Nav} from 'ionic/components'
|
||||
import {View} from 'ionic/components/view/view'
|
||||
|
||||
@Component({
|
||||
selector: 'second-page'
|
||||
})
|
||||
@NgView({
|
||||
templateUrl: 'pages/second-page.html',
|
||||
directives: [View]
|
||||
})
|
||||
export class SecondPage {
|
||||
constructor(
|
||||
@Parent() viewport: Nav
|
||||
) {
|
||||
this.viewport = viewport
|
||||
}
|
||||
pop() {
|
||||
this.viewport.pop()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user