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