Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -6,9 +6,9 @@ import { Injectable } from '@angular/core';
|
||||
export class Products {
|
||||
getProductList() {
|
||||
return [
|
||||
{ id: 1, name: 'Rindburger', price: 14.95, img: '/burger.webp' },
|
||||
{ id: 2, name: 'Pouletburger', price: 16.95, img: '/burger.webp' },
|
||||
{ id: 3, name: 'Veggieburger', price: 20.95, img: '/burgerveggie.png' },
|
||||
{ id: 1, name: 'Rindburger', price: 14.95, img: '/rindburger.png' },
|
||||
{ id: 2, name: 'Pouletburger', price: 16.95, img: '/krabsburger.png' },
|
||||
{ id: 3, name: 'Veggieburger', price: 20.95, img: '/veggieburger.png' },
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<div class="navbar">
|
||||
<img src="/favicon.png" alt="Logo">
|
||||
<h1>Burgers</h1>
|
||||
</div>
|
||||
<div class="products">
|
||||
|
||||
@for (item of productList; track $index) {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
.navbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
img {
|
||||
height: 40px;
|
||||
}
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
color: #333;
|
||||
border-bottom: #333 2px solid;
|
||||
}
|
||||
}
|
||||
|
||||
.products {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -8,6 +24,6 @@
|
||||
|
||||
sdx-card {
|
||||
height: auto;
|
||||
width: 75%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<title>Burgerladen</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.png">
|
||||
</head>
|
||||
|
||||
<body class="sdx">
|
||||
|
||||
Reference in New Issue
Block a user