You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
frontend/src/app/app.component.ts

56 lines
1.1 KiB

import { Component } from "@angular/core";
import { Platform } from "@ionic/angular";
import { SplashScreen } from "@ionic-native/splash-screen/ngx";
import { StatusBar } from "@ionic-native/status-bar/ngx";
import { ApiService } from "./service/api.service";
@Component({
selector: "app-root",
templateUrl: "app.component.html",
styleUrls: ["app.component.scss"]
})
export class AppComponent {
public appPages = [
{
title: "Home",
url: "/home",
icon: "home"
},
{
title: "List",
url: "/list",
icon: "list"
},
{
title: "Editor",
url: "/editor",
icon: "edit"
}
];
public nodes = [];
constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar,
private api: ApiService
) {
this.initializeApp();
}
ionViewDidEnter() {
this.api.get("/menu/items").subscribe(result => {
this.nodes = result.data;
});
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
}