Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

19 рядки
496 B

  1. import { EventEmitter } from "@angular/core";
  2. import { Subject } from "rxjs/Subject";
  3. import { Recipe } from "./recipe.model";
  4. import { Ingredient } from "../shared/ingredient.model";
  5. export class RecipeService {
  6. recipesChanged = new Subject<Recipe[]>();
  7. private recipes: Recipe[] = [];
  8. replaceRecipes(recipes: Recipe[]) {
  9. this.recipes = recipes;
  10. this.recipesChanged.next(this.recipes.slice());
  11. }
  12. getRecipes() {
  13. return this.recipes.slice();
  14. }
  15. }