]> gitweb.hhaalo.de Git - speisekarten-editor.git/commitdiff
add: bind food ngmodel
authorBastian Dehn <hhaalo@arcor.de>
Mon, 6 Jun 2022 10:19:59 +0000 (12:19 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 6 Jun 2022 10:19:59 +0000 (12:19 +0200)
src/app/app.component.html
src/app/app.component.ts
src/app/ifood-card.ts [new file with mode: 0644]
src/app/ifood.ts [new file with mode: 0644]
src/app/isubtitle.ts [new file with mode: 0644]
src/app/ititle.ts [new file with mode: 0644]

index a774c89841715fdb405982fb3e1fa4418bc5cccb..d556a0cf89f39a193af532c18f1d910698378dd6 100644 (file)
 
 <form #formFood="ngForm" *ngIf="formFoodVisible" class="form">
        <label>Speise</label>
-       <input name="food" type="text" />
+       <input [(ngModel)]="food.Food" name="food" type="text" />
        <label>Beilage</label>
-       <input name="sideDish" type="text" />
+       <input [(ngModel)]="food.sideDish" name="sideDish" type="text" />
        <label>Preis</label>
-       <input name="price" type="text" />
+       <input [(ngModel)]="food.price" name="price" type="text" />
        <button class="button"
                type="button"
                id="addFood">Hinzufügen</button>
index 591df673281381f4f9d9e7b5db1862fdc36fca26..b16891037c300df6d6abeb4cf9ce77148155f19f 100644 (file)
@@ -1,4 +1,5 @@
 import { Component } from '@angular/core';
+import { IFood } from './ifood';
 
 @Component({
        selector: 'app-root',
@@ -10,6 +11,11 @@ export class AppComponent
 {
        public title: string = ""
        public subtitle: string = ""
+       public food: IFood = {
+               Food: "",
+               sideDish: "",
+               price: ""
+       }
        public formTitleVisible: boolean = false;
        public formSubtitleVisible: boolean = false;
        public formFoodVisible: boolean = false;
diff --git a/src/app/ifood-card.ts b/src/app/ifood-card.ts
new file mode 100644 (file)
index 0000000..2f3c1ea
--- /dev/null
@@ -0,0 +1,6 @@
+import { ITitle } from './ititle';
+
+export interface IFoodCard
+{
+       Titles: ITitle[];
+}
diff --git a/src/app/ifood.ts b/src/app/ifood.ts
new file mode 100644 (file)
index 0000000..30f8230
--- /dev/null
@@ -0,0 +1,6 @@
+export interface IFood
+{
+       Food: string;
+       sideDish: string;
+       price: string;
+}
diff --git a/src/app/isubtitle.ts b/src/app/isubtitle.ts
new file mode 100644 (file)
index 0000000..330289e
--- /dev/null
@@ -0,0 +1,6 @@
+import { IFood } from './ifood';
+
+export interface ISubtitle
+{
+       Foods: IFood[];
+}
diff --git a/src/app/ititle.ts b/src/app/ititle.ts
new file mode 100644 (file)
index 0000000..34268db
--- /dev/null
@@ -0,0 +1,6 @@
+import { ISubtitle } from './isubtitle'
+
+export interface ITitle
+{
+       Subtitles: ISubtitle[];
+}