want to extract recipe list from recipe detail. But still have no idea about link formControl between 2 component
This commit is contained in:
parent
72f27f198d
commit
bb29e7de5a
7 changed files with 257 additions and 130 deletions
|
|
@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
|
|||
import { Observable, tap } from 'rxjs';
|
||||
import { Recipe, Recipe01 } from '../models/recipe.model';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { RecipeMetaData } from 'src/app/shared/types/recipe';
|
||||
|
||||
interface RecipeParams {
|
||||
version: string;
|
||||
|
|
@ -62,25 +63,11 @@ export class RecipeService {
|
|||
|
||||
getRecipesById(id: string): Observable<{
|
||||
recipe: Recipe01;
|
||||
recipeMetaData: {
|
||||
productCode: string;
|
||||
name: string;
|
||||
otherName: string;
|
||||
description: string;
|
||||
otherDescription: string;
|
||||
picture: string;
|
||||
};
|
||||
recipeMetaData: RecipeMetaData;
|
||||
}> {
|
||||
return this._httpClient.get<{
|
||||
recipe: Recipe01;
|
||||
recipeMetaData: {
|
||||
productCode: string;
|
||||
name: string;
|
||||
otherName: string;
|
||||
description: string;
|
||||
otherDescription: string;
|
||||
picture: string;
|
||||
};
|
||||
recipeMetaData: RecipeMetaData;
|
||||
}>(environment.api + '/recipes/' + id, {
|
||||
withCredentials: true,
|
||||
responseType: 'json',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue