add recipe component
This commit is contained in:
@@ -1 +1,3 @@
|
|||||||
Tiramisu
|
Tiramisu
|
||||||
|
|
||||||
|
<router-outlet></router-outlet>
|
@@ -1,10 +1,10 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { RouterOutlet } from '@angular/router';
|
import { RouterOutlet, RouterLink, RouterLinkActive } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterOutlet],
|
imports: [RouterOutlet, RouterLink, RouterLinkActive],
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrl: './app.component.css',
|
styleUrl: './app.component.css',
|
||||||
})
|
})
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
|
import {RecipeComponent} from './recipe/recipe.component'
|
||||||
|
|
||||||
export const routes: Routes = [];
|
export const routes: Routes = [
|
||||||
|
{ path: 'recipe/:id', component: RecipeComponent}
|
||||||
|
];
|
||||||
|
1
src/app/recipe/recipe.component.html
Normal file
1
src/app/recipe/recipe.component.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<p>recipe works!</p>
|
23
src/app/recipe/recipe.component.spec.ts
Normal file
23
src/app/recipe/recipe.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { RecipeComponent } from './recipe.component';
|
||||||
|
|
||||||
|
describe('RecipeComponent', () => {
|
||||||
|
let component: RecipeComponent;
|
||||||
|
let fixture: ComponentFixture<RecipeComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [RecipeComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(RecipeComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
17
src/app/recipe/recipe.component.ts
Normal file
17
src/app/recipe/recipe.component.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-recipe',
|
||||||
|
standalone: true,
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './recipe.component.html',
|
||||||
|
})
|
||||||
|
export class RecipeComponent {
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
set id(id: string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user