Ви не можете вибрати більше 25 тем
Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
|
- import { EventEmitter } from "@angular/core";
- import { Subject } from "rxjs/Subject";
-
- import { Recipe } from "./recipe.model";
- import { Ingredient } from "../shared/ingredient.model";
-
- export class RecipeService {
- recipesChanged = new Subject<Recipe[]>();
- private recipes: Recipe[] = [];
-
- replaceRecipes(recipes: Recipe[]) {
- this.recipes = recipes;
- this.recipesChanged.next(this.recipes.slice());
- }
-
- getRecipes() {
- return this.recipes.slice();
- }
- }
|