app.component.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { Component, ViewChild } from '@angular/core';
  2. import { Nav, Platform } from 'ionic-angular';
  3. import { StatusBar } from '@ionic-native/status-bar';
  4. import { SplashScreen } from '@ionic-native/splash-screen';
  5. import { Page1 } from '../pages/page1/page1';
  6. import { PressurePage } from '../pages/pressure/pressure';
  7. import { PreinfusionPage } from '../pages/preinfusion/preinfusion';
  8. import { TemperaturePage } from '../pages/temperature/temperature';
  9. import { TimersPage } from '../pages/timers/timers';
  10. import { PIDPage } from '../pages/pid/pid';
  11. import { HardwarePage } from '../pages/hardware/hardware';
  12. import { InstallationPage } from '../pages/installation/installation';
  13. import { AboutPage } from '../pages/about/about';
  14. import { DemosPage } from '../pages/demos/demos';
  15. import { MeBaristaService } from '../providers/me-barista-service';
  16. @Component({
  17. templateUrl: 'app.html'
  18. //,
  19. //providers: [MeBaristaService]
  20. })
  21. export class MyApp {
  22. @ViewChild(Nav) nav: Nav;
  23. rootPage: any = Page1;
  24. pages: Array<{title: string, component: any}>;
  25. constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public abc: MeBaristaService) {
  26. this.initializeApp();
  27. // used for an example of ngFor and navigation
  28. this.pages = [
  29. { title: 'Home', component: Page1 },
  30. { title: 'Temperature', component: TemperaturePage },
  31. { title: 'Preinfusion', component: PreinfusionPage },
  32. { title: 'Pressure', component: PressurePage },
  33. { title: 'Timers', component: TimersPage },
  34. { title: 'PID', component: PIDPage },
  35. { title: 'Hardware', component: HardwarePage },
  36. { title: 'Demos', component: DemosPage },
  37. { title: 'Installation', component: InstallationPage },
  38. { title: 'About', component: AboutPage }
  39. ];
  40. }
  41. initializeApp() {
  42. this.platform.ready().then(() => {
  43. // Okay, so the platform is ready and our plugins are available.
  44. // Here you can do any higher level native things you might need.
  45. this.statusBar.styleDefault();
  46. this.splashScreen.hide();
  47. this.abc.startup();
  48. });
  49. }
  50. openPage(page) {
  51. // Reset the content nav to have just this page
  52. // we wouldn't want the back button to show in this scenario
  53. this.nav.setRoot(page.component);
  54. }
  55. }