From 7743f0b8756eefa877f0ab0001617f9d8f6a1528 Mon Sep 17 00:00:00 2001 From: schencej Date: Sun, 8 Dec 2019 18:23:06 -0500 Subject: added recipePass service --- .../src/app/recipePass/recipe-pass.service.spec.ts | 12 ++++++++++++ .../src/app/recipePass/recipe-pass.service.ts | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 recipeBuddy/src/app/recipePass/recipe-pass.service.spec.ts create mode 100644 recipeBuddy/src/app/recipePass/recipe-pass.service.ts diff --git a/recipeBuddy/src/app/recipePass/recipe-pass.service.spec.ts b/recipeBuddy/src/app/recipePass/recipe-pass.service.spec.ts new file mode 100644 index 0000000..f3a8388 --- /dev/null +++ b/recipeBuddy/src/app/recipePass/recipe-pass.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { RecipePassService } from './recipe-pass.service'; + +describe('RecipePassService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: RecipePassService = TestBed.get(RecipePassService); + expect(service).toBeTruthy(); + }); +}); diff --git a/recipeBuddy/src/app/recipePass/recipe-pass.service.ts b/recipeBuddy/src/app/recipePass/recipe-pass.service.ts new file mode 100644 index 0000000..e925973 --- /dev/null +++ b/recipeBuddy/src/app/recipePass/recipe-pass.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { Recipe } from '../DataModels/recipe'; + +@Injectable({ + providedIn: 'root', +}) +export class RecipePassService { + + private sourceRecipe: Recipe; + + constructor() { } + + public setRecipe (recipeToPass: Recipe) { + this.sourceRecipe = recipeToPass; + } + + public getRecipe (): Recipe { + return this.sourceRecipe; + } +} -- 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/ingredient.ts | 8 ++++---- recipeBuddy/src/app/DataModels/recipe.ts | 22 +++++++++++----------- recipeBuddy/src/app/DataModels/step.ts | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/recipeBuddy/src/app/DataModels/ingredient.ts b/recipeBuddy/src/app/DataModels/ingredient.ts index c79b475..720514c 100644 --- a/recipeBuddy/src/app/DataModels/ingredient.ts +++ b/recipeBuddy/src/app/DataModels/ingredient.ts @@ -1,8 +1,8 @@ export class Ingredient { - private name: string; - private amount: number; - private unit: string; - private type_: string; + public name: string; + public amount: number; + public unit: string; + public type_: string; public constructor(name: string, amount: number, unit: string, type_: string) { this.name = name; 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; diff --git a/recipeBuddy/src/app/DataModels/step.ts b/recipeBuddy/src/app/DataModels/step.ts index 1c1ca7b..06c15c9 100644 --- a/recipeBuddy/src/app/DataModels/step.ts +++ b/recipeBuddy/src/app/DataModels/step.ts @@ -1,8 +1,8 @@ export class Step { - private instruction: string; - private timer: number; + public instruction: string; + public timer: number; - public contructor(instruction: string, timer: number) { + public constructor(instruction: string, timer: number) { this.instruction = instruction; this.timer = timer; } -- cgit v1.1 From 161b1a1b2c3023da26388719cf962039742de350 Mon Sep 17 00:00:00 2001 From: schencej Date: Mon, 9 Dec 2019 17:38:03 -0500 Subject: added additional functionality to cook page --- .../src/app/cook-page/cook-page.component.css | 14 ++++ .../src/app/cook-page/cook-page.component.html | 22 +++--- .../src/app/cook-page/cook-page.component.ts | 78 ++++++++++++++++------ .../cook-page/step-card/step-card.component.css | 0 .../cook-page/step-card/step-card.component.html | 1 - .../step-card/step-card.component.spec.ts | 25 ------- .../app/cook-page/step-card/step-card.component.ts | 9 --- 7 files changed, 83 insertions(+), 66 deletions(-) delete mode 100644 recipeBuddy/src/app/cook-page/step-card/step-card.component.css delete mode 100644 recipeBuddy/src/app/cook-page/step-card/step-card.component.html delete mode 100644 recipeBuddy/src/app/cook-page/step-card/step-card.component.spec.ts delete mode 100644 recipeBuddy/src/app/cook-page/step-card/step-card.component.ts diff --git a/recipeBuddy/src/app/cook-page/cook-page.component.css b/recipeBuddy/src/app/cook-page/cook-page.component.css index 41b3d42..4f44224 100644 --- a/recipeBuddy/src/app/cook-page/cook-page.component.css +++ b/recipeBuddy/src/app/cook-page/cook-page.component.css @@ -11,13 +11,20 @@ .previous { margin: auto; + width: 200px; + height: 200px; border: solid; + align: center; text-align: center; grid-column: 1; + + } .current { margin: auto; + width: 300px; + height:300px; border: solid; text-align: center; grid-column: 2; @@ -25,7 +32,10 @@ .next { margin: auto; + width: 200px; + height: 200px; border: solid; + align: center; text-align: center; grid-column: 3; @@ -37,3 +47,7 @@ grid-gap: 10px; grid-template-rows: 1fr; } + +.step-count { + text-align: center; +} diff --git a/recipeBuddy/src/app/cook-page/cook-page.component.html b/recipeBuddy/src/app/cook-page/cook-page.component.html index 39bef2e..db1c0a8 100644 --- a/recipeBuddy/src/app/cook-page/cook-page.component.html +++ b/recipeBuddy/src/app/cook-page/cook-page.component.html @@ -1,22 +1,26 @@
-