Renaming and moving.
This commit is contained in:
parent
6ae8da85f9
commit
68eeeb9467
@ -1,5 +1,5 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import { RecipeView } from './recipe-view/recipe-view.component';
|
||||
import { RecipeView } from './recipe-view/recipe-view';
|
||||
import { RecipesPage } from './recipes-page/recipes-page';
|
||||
|
||||
export const routes: Routes = [
|
||||
|
||||
10
src/app/model/ImageView.model.ts
Normal file
10
src/app/model/ImageView.model.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { ResourceOwner } from "./ResourceOwner.model";
|
||||
|
||||
export interface ImageView {
|
||||
alt: string;
|
||||
filename: string;
|
||||
height: number | null;
|
||||
owner: ResourceOwner;
|
||||
url: string;
|
||||
width: number | null;
|
||||
}
|
||||
@ -1,3 +1,6 @@
|
||||
import { ResourceOwner } from './ResourceOwner.model';
|
||||
import { ImageView } from './ImageView.model';
|
||||
|
||||
export interface RecipeInfoViews {
|
||||
slice: {
|
||||
number: number;
|
||||
@ -21,16 +24,3 @@ export interface Recipe {
|
||||
title: string;
|
||||
}
|
||||
|
||||
export interface ResourceOwner {
|
||||
id: number;
|
||||
username: string;
|
||||
}
|
||||
|
||||
export interface ImageView {
|
||||
alt: string;
|
||||
filename: string;
|
||||
height: number | null;
|
||||
owner: ResourceOwner;
|
||||
url: string;
|
||||
width: number | null;
|
||||
}
|
||||
|
||||
4
src/app/model/ResourceOwner.model.ts
Normal file
4
src/app/model/ResourceOwner.model.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface ResourceOwner {
|
||||
id: number;
|
||||
username: string;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RecipeViewCard } from './recipe-view-card.component';
|
||||
import { RecipeViewCard } from './recipe-view-card';
|
||||
|
||||
describe('Card', () => {
|
||||
let component: RecipeViewCard;
|
||||
@ -6,8 +6,8 @@ import { ImageService } from '../../service/image.service';
|
||||
@Component({
|
||||
selector: 'app-recipe-view-card',
|
||||
imports: [],
|
||||
templateUrl: './recipe-view-card.component.html',
|
||||
styleUrl: './recipe-view-card.component.css',
|
||||
templateUrl: './recipe-view-card.html',
|
||||
styleUrl: './recipe-view-card.css',
|
||||
})
|
||||
export class RecipeViewCard {
|
||||
@Input({ required: true })
|
||||
@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RecipeView } from './recipe-view.component';
|
||||
import { RecipeView } from './recipe-view';
|
||||
|
||||
describe('Recipe', () => {
|
||||
let component: RecipeView;
|
||||
@ -1,14 +1,14 @@
|
||||
import { Component, inject, resource } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RecipeService } from '../recipe.service';
|
||||
import { RecipeViewCard } from './recipe-view-card/recipe-view-card.component';
|
||||
import { RecipeService } from '../service/recipe.service';
|
||||
import { RecipeViewCard } from './recipe-view-card/recipe-view-card';
|
||||
import { injectQuery } from '@tanstack/angular-query-experimental';
|
||||
|
||||
@Component({
|
||||
selector: 'app-recipe-view',
|
||||
imports: [RecipeViewCard],
|
||||
templateUrl: './recipe-view.component.html',
|
||||
styleUrl: './recipe-view.component.css',
|
||||
templateUrl: './recipe-view.html',
|
||||
styleUrl: './recipe-view.css',
|
||||
})
|
||||
export class RecipeView {
|
||||
private recipeService = inject(RecipeService);
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { RecipeService } from '../recipe.service';
|
||||
import { RecipeService } from '../service/recipe.service';
|
||||
import { injectQuery } from '@tanstack/angular-query-experimental';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { firstValueFrom, map } from 'rxjs';
|
||||
import { Recipe, RecipeInfoViews, RecipeView } from './model/Recipe.model';
|
||||
import { Recipe, RecipeInfoViews, RecipeView } from '../model/Recipe.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
Loading…
Reference in New Issue
Block a user