add basic routing and nav-bar #2
Merged
remi.arnal
merged 1 commits from routing
into master
12 months ago
@ -1,6 +1,12 @@
|
||||
<h1>Ratatouille</h1>
|
||||
|
||||
<div class="wrapper">
|
||||
<app-recipe-list></app-recipe-list>
|
||||
<app-recipe-form></app-recipe-form>
|
||||
</div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a routerLink="/" routerLinkActive="active" ariaCurrentWhenActive="page">Home</a></li>
|
||||
<li><a routerLink="/add" routerLinkActive="active" ariaCurrentWhenActive="page">Add Recipe</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div id="page-wrapper">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
@ -1,3 +1,9 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import { Routes } from '@angular/router'
|
||||
|
||||
export const routes: Routes = [];
|
||||
import { RecipeFormComponent } from "./recipe-form/recipe-form.component";
|
||||
import { RecipeListComponent } from "./components/recipe-list/recipe-list.component";
|
||||
|
||||
export const routes: Routes = [
|
||||
{ path: 'add', component: RecipeFormComponent },
|
||||
{ path: '', component: RecipeListComponent }
|
||||
];
|
||||
|
@ -0,0 +1,5 @@
|
||||
#recipe-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 2rem;
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
<p>recipe-list works!</p>
|
||||
<div>
|
||||
<div id="recipe-list">
|
||||
<app-recipe-mini *ngFor="let recipe of recipes" [recipe]="recipe"></app-recipe-mini>
|
||||
</div>
|
||||
</div>
|
@ -1,10 +1,11 @@
|
||||
<div class="recipe-card">
|
||||
<div class="recipe-image">
|
||||
<img [src]="recipe.image" onerror="this.onerror=null;this.src='https://placehold.co/100x100';" alt="{{recipe.name}}">
|
||||
<img [src]="recipe.image" onerror="this.onerror=null;this.src='https://placehold.co/100x100';"
|
||||
alt="{{recipe.name}}">
|
||||
</div>
|
||||
<div class="recipe-details">
|
||||
<h2>{{recipe.name}}</h2>
|
||||
<p>{{recipe.description}}</p>
|
||||
<button (click)="navigateToRecipe()" style="--clr:#39FF14"><span>Voir la recette</span><i></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1 +1,3 @@
|
||||
/* You can add global styles to this file, and also import other style files */
|
||||
:root {
|
||||
font-family: "Helvetica";
|
||||
}
|
Loading…
Reference in new issue