<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>
import { Component } from '@angular/core';
+import { IFood } from './ifood';
@Component({
selector: 'app-root',
{
public title: string = ""
public subtitle: string = ""
+ public food: IFood = {
+ Food: "",
+ sideDish: "",
+ price: ""
+ }
public formTitleVisible: boolean = false;
public formSubtitleVisible: boolean = false;
public formFoodVisible: boolean = false;
--- /dev/null
+import { ITitle } from './ititle';
+
+export interface IFoodCard
+{
+ Titles: ITitle[];
+}
--- /dev/null
+export interface IFood
+{
+ Food: string;
+ sideDish: string;
+ price: string;
+}
--- /dev/null
+import { IFood } from './ifood';
+
+export interface ISubtitle
+{
+ Foods: IFood[];
+}
--- /dev/null
+import { ISubtitle } from './isubtitle'
+
+export interface ITitle
+{
+ Subtitles: ISubtitle[];
+}