2016-09-12 18:13:56 -04:00
|
|
|
import {Component, ViewChild} from "@angular/core";
|
|
|
|
import {ionicBootstrap, Platform, MenuController, Nav} from "ionic-angular";
|
|
|
|
import {StatusBar} from "ionic-native";
|
|
|
|
import {SearchPage} from "./pages/search/search";
|
2016-09-12 13:12:25 -04:00
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
2016-09-12 18:13:56 -04:00
|
|
|
templateUrl: "build/app.html"
|
2016-09-12 13:12:25 -04:00
|
|
|
})
|
|
|
|
class MyApp
|
|
|
|
{
|
|
|
|
@ViewChild(Nav) nav: Nav;
|
|
|
|
|
|
|
|
// make HelloIonicPage the root (or first) page
|
|
|
|
rootPage: any = SearchPage;
|
|
|
|
pages: Array<{ title: string, component: any }>;
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
public platform: Platform,
|
|
|
|
public menu: MenuController
|
|
|
|
)
|
|
|
|
{
|
|
|
|
this.initializeApp();
|
|
|
|
|
|
|
|
// set our app's pages
|
|
|
|
this.pages = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
// close the menu when clicking a link from the menu
|
|
|
|
this.menu.close();
|
|
|
|
// navigate to the new page if it is not the current page
|
|
|
|
this.nav.setRoot(page.component);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ionicBootstrap(MyApp);
|