From 5fdef8455c33dcd192497c6fe0217ccb89e8bf66 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Fri, 6 Dec 2019 15:18:01 -0500 Subject: Fix constructors for Step and Recipe data models --- recipeBuddy/src/app/DataModels/recipe.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'recipeBuddy/src/app/DataModels/recipe.ts') diff --git a/recipeBuddy/src/app/DataModels/recipe.ts b/recipeBuddy/src/app/DataModels/recipe.ts index 368f237..937153f 100644 --- a/recipeBuddy/src/app/DataModels/recipe.ts +++ b/recipeBuddy/src/app/DataModels/recipe.ts @@ -14,7 +14,17 @@ export class Recipe { private tags: string[]; private photos: string[]; - public constructor(id: number, name: string, description: string, ingredients: Ingredient[], steps: Step[], servingSize: number, cookTime: number, rating: number, tags: string[]) { + public constructor(id: number, + name: string, + description: string, + ingredients: Ingredient[], + steps: Step[], + servingSize: number, + cookTime: number, + timesCooked: number, + rating: number, + tags: string[], + photos: string[]) { this.id = id; this.name = name; this.description = description; @@ -24,6 +34,8 @@ export class Recipe { this.cookTime = cookTime; this.rating = rating; this.tags = tags; + this.photos = photos; + this.timesCooked = timesCooked; } public getId(): number { -- cgit v1.1 From 4f2f07dd448739c5b620a4ac5f3457349b737e00 Mon Sep 17 00:00:00 2001 From: schencej Date: Mon, 9 Dec 2019 17:36:10 -0500 Subject: made all data model member variables public --- recipeBuddy/src/app/DataModels/recipe.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'recipeBuddy/src/app/DataModels/recipe.ts') diff --git a/recipeBuddy/src/app/DataModels/recipe.ts b/recipeBuddy/src/app/DataModels/recipe.ts index 368f237..9d833be 100644 --- a/recipeBuddy/src/app/DataModels/recipe.ts +++ b/recipeBuddy/src/app/DataModels/recipe.ts @@ -2,17 +2,17 @@ import {Step} from "./step" import {Ingredient} from "./ingredient" export class Recipe { - private id: number; - private name: string; - private description: string; - private ingredients: Ingredient[]; - private steps: Step[]; - private servingSize: number; - private cookTime: number; - private timesCooked: number; - private rating: number; - private tags: string[]; - private photos: string[]; + public id: number; + public name: string; + public description: string; + public ingredients: Ingredient[]; + public steps: Step[]; + public servingSize: number; + public cookTime: number; + public timesCooked: number; + public rating: number; + public tags: string[]; + public photos: string[]; public constructor(id: number, name: string, description: string, ingredients: Ingredient[], steps: Step[], servingSize: number, cookTime: number, rating: number, tags: string[]) { this.id = id; -- cgit v1.1