diff --git a/src/app/app.component.html b/src/app/app.component.html index 87b8715..60639e0 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,25 +1,37 @@ - - - - + - + +
+ + + + +
-
+ \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ba56e2b..015d4ed 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,6 +3,7 @@ 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", @@ -28,37 +29,23 @@ export class AppComponent { } ]; - public nodes = [ - { - id: 1, - name: "root1", - children: [ - { id: 2, name: "child1" }, - { id: 3, name: "child2" } - ] - }, - { - id: 4, - name: "root2", - children: [ - { id: 5, name: "child2.1" }, - { - id: 6, - name: "child2.2", - children: [{ id: 7, name: "subsub" }] - } - ] - } - ]; + public nodes = []; constructor( private platform: Platform, private splashScreen: SplashScreen, - private statusBar: StatusBar + 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(); diff --git a/src/app/pages/editor/editor.page.html b/src/app/pages/editor/editor.page.html index d761f94..7a8fd70 100644 --- a/src/app/pages/editor/editor.page.html +++ b/src/app/pages/editor/editor.page.html @@ -1,5 +1,12 @@ + + + + + + + {{ pageRecord.Name }} @@ -8,13 +15,9 @@
- + +
@@ -22,4 +25,4 @@ Save
- + \ No newline at end of file