/
app.ts
55 lines (43 loc) · 1.59 KB
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { Component, ViewChild } from '@angular/core';
import { Platform, ionicBootstrap, Nav } from 'ionic-angular';
import { StatusBar } from 'ionic-native';
import { HomePage } from './pages/home/home';
import { AboutPage } from './pages/about/about';
import { AskStoriesPage } from './pages/ask-stories/ask-stories';
import { ShowStoriesPage } from './pages/show-stories/show-stories';
@Component({
templateUrl: 'build/app.html'
})
export class MyApp {
@ViewChild(Nav) nav: Nav;
private rootPage: any = HomePage;
pages: Array<{title: string, component: any}>;
constructor(private platform:Platform) {
this.initializeApp();
// used for an example of ngFor and navigation
this.pages = [
{ title: 'Top Stories', component: HomePage },
{ title: 'Ask Stories', component: AskStoriesPage },
{ title: 'Show Stories', component: ShowStoriesPage },
{ title: 'Jobs', component: AboutPage }
];
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
});
}
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
});
}
openPage(page: any) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
this.nav.setRoot(page.component);
}
}
ionicBootstrap(MyApp);