From f485f743dbf84589cef6cde4194088033d376732 Mon Sep 17 00:00:00 2001 From: Jeremy Kepf Date: Sun, 1 Mar 2020 16:21:37 -0500 Subject: [PATCH] max-64 g-18 --- .../recipe-detail.component.html | 33 ++++++++++++++++++- .../recipe-list2/recipe-list2.component.html | 24 +++++++++++++- .../recipe-list2/recipe-list2.component.ts | 20 +++++++---- src/app/recipes/recipe.model.ts | 11 +++++++ src/app/shared/ingredient.model.ts | 6 ++++ .../shopping-edit.component.html | 24 +++++++++++++- .../shopping-list.component.html | 8 ++++- .../shopping-list/shopping-list.component.ts | 17 ++++++---- 8 files changed, 125 insertions(+), 18 deletions(-) create mode 100644 src/app/recipes/recipe.model.ts create mode 100644 src/app/shared/ingredient.model.ts diff --git a/src/app/recipes/recipe-detail/recipe-detail.component.html b/src/app/recipes/recipe-detail/recipe-detail.component.html index 75833e3..07db241 100644 --- a/src/app/recipes/recipe-detail/recipe-detail.component.html +++ b/src/app/recipes/recipe-detail/recipe-detail.component.html @@ -1 +1,32 @@ -

recipe-detail works!

+
+
+ +
+
+
+
+

Recipe Name

+
+
+
+
+
+ + +
+
+
+
+
+ Description +
+
+
+
+ Ingredients +
+
diff --git a/src/app/recipes/recipe-list2/recipe-list2.component.html b/src/app/recipes/recipe-list2/recipe-list2.component.html index 60ecf13..7670460 100644 --- a/src/app/recipes/recipe-list2/recipe-list2.component.html +++ b/src/app/recipes/recipe-list2/recipe-list2.component.html @@ -1 +1,23 @@ - +
+
+ +
+
+
+
+ +
diff --git a/src/app/recipes/recipe-list2/recipe-list2.component.ts b/src/app/recipes/recipe-list2/recipe-list2.component.ts index 187ba3d..969e236 100644 --- a/src/app/recipes/recipe-list2/recipe-list2.component.ts +++ b/src/app/recipes/recipe-list2/recipe-list2.component.ts @@ -1,15 +1,21 @@ import { Component, OnInit } from '@angular/core'; +import { Recipe } from '../recipe.model'; @Component({ - selector: 'app-recipe-list2', - templateUrl: './recipe-list2.component.html', - styleUrls: ['./recipe-list2.component.css'] + selector: "app-recipe-list2", + templateUrl: "./recipe-list2.component.html", + styleUrls: ["./recipe-list2.component.css"] }) export class RecipeList2Component implements OnInit { + recipes: Recipe[] = [ + new Recipe( + "A Test Recipe", + "This is simply a test", + "https://food.fnr.sndimg.com/content/dam/images/food/fullset/2018/9/26/0/FNK_Tuscan-Chicken-Skillet_H2_s4x3.jpg" + ) + ]; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} } diff --git a/src/app/recipes/recipe.model.ts b/src/app/recipes/recipe.model.ts new file mode 100644 index 0000000..03e495e --- /dev/null +++ b/src/app/recipes/recipe.model.ts @@ -0,0 +1,11 @@ +export class Recipe { + public name: string; + public description: string; + public imagePath: string; + + constructor(name: string, desc: string, imagePath: string) { + this.name = name; + this.description = desc; + this.imagePath = imagePath; + } +} \ No newline at end of file diff --git a/src/app/shared/ingredient.model.ts b/src/app/shared/ingredient.model.ts new file mode 100644 index 0000000..1573cb9 --- /dev/null +++ b/src/app/shared/ingredient.model.ts @@ -0,0 +1,6 @@ +export class Ingredient { + + constructor(public name: string, public amount: number) { + + } +} \ No newline at end of file diff --git a/src/app/shopping-list/shopping-edit/shopping-edit.component.html b/src/app/shopping-list/shopping-edit/shopping-edit.component.html index c98d6a9..b03491e 100644 --- a/src/app/shopping-list/shopping-edit/shopping-edit.component.html +++ b/src/app/shopping-list/shopping-edit/shopping-edit.component.html @@ -1 +1,23 @@ -

shopping-edit works!

+
+
+
+
+
+ + +
+
+ + +
+
+
+
+ + + +
+
+
+
+
diff --git a/src/app/shopping-list/shopping-list.component.html b/src/app/shopping-list/shopping-list.component.html index 57769d4..5835b63 100644 --- a/src/app/shopping-list/shopping-list.component.html +++ b/src/app/shopping-list/shopping-list.component.html @@ -2,6 +2,12 @@

-

The list

+
diff --git a/src/app/shopping-list/shopping-list.component.ts b/src/app/shopping-list/shopping-list.component.ts index 991add0..27fabbf 100644 --- a/src/app/shopping-list/shopping-list.component.ts +++ b/src/app/shopping-list/shopping-list.component.ts @@ -1,15 +1,18 @@ import { Component, OnInit } from '@angular/core'; +import { Ingredient } from '../shared/ingredient.model'; @Component({ - selector: 'app-shopping-list', - templateUrl: './shopping-list.component.html', - styleUrls: ['./shopping-list.component.css'] + selector: "app-shopping-list", + templateUrl: "./shopping-list.component.html", + styleUrls: ["./shopping-list.component.css"] }) export class ShoppingListComponent implements OnInit { + ingredients: Ingredient[] = [ + new Ingredient("Apples", 5), + new Ingredient("Tomatoes", 10) + ]; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} }