diff options
author | schencej <schencej@clarkson.edu> | 2019-12-08 18:23:06 -0500 |
---|---|---|
committer | schencej <schencej@clarkson.edu> | 2019-12-08 18:23:06 -0500 |
commit | 7743f0b8756eefa877f0ab0001617f9d8f6a1528 (patch) | |
tree | f720c98103aedae94f49f77bb95dfeceed78b586 /recipeBuddy/src/app | |
parent | 5cf3689290666f70cd631d7b3d40a2ed245a3fce (diff) |
added recipePass service
Diffstat (limited to 'recipeBuddy/src/app')
-rw-r--r-- | recipeBuddy/src/app/recipePass/recipe-pass.service.spec.ts | 12 | ||||
-rw-r--r-- | recipeBuddy/src/app/recipePass/recipe-pass.service.ts | 20 |
2 files changed, 32 insertions, 0 deletions
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; + } +} |