My interface
export interface Meal {
strMeal: string;
strCategory: string;
strArea: string;
}
export interface MealsResponse {
meals: Meal[];
}
export interface MyMeal {
name: string;
category: string;
area: string;
}
getMeals(mealName: string): Observable<MealsResponse> {
return this.http.get<MealsResponse>(`${this.url}search.php?s=${mealName}`).pipe(
map((response: MealsResponse) => {
return response;
})
);
}
How do i map Meal to MyMeal? (Reason behind this Meal interface is direct TS version of Json that comes from api, and api property names will change)