From 9947445b4592cdabfdf2f7e8c9c03fafc60cca8e Mon Sep 17 00:00:00 2001 From: Michael Branders Date: Fri, 31 May 2024 15:05:39 +0200 Subject: [PATCH] sock card --- .../app/sock-card/sock-card.component.html | 14 ++++++++++++++ .../src/app/sock-card/sock-card.component.ts | 16 ++++++++++++++++ .../src/app/socks/shop.component.html | 19 +++---------------- .../src/app/socks/sock.component.html | 13 +------------ 4 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 itenium-socks/src/app/sock-card/sock-card.component.html create mode 100644 itenium-socks/src/app/sock-card/sock-card.component.ts diff --git a/itenium-socks/src/app/sock-card/sock-card.component.html b/itenium-socks/src/app/sock-card/sock-card.component.html new file mode 100644 index 0000000..51c5908 --- /dev/null +++ b/itenium-socks/src/app/sock-card/sock-card.component.html @@ -0,0 +1,14 @@ +
+ +
+ +
+
+
{{ sock.name }}
+
{{ sock.price }}
+
+
+ +
+
+
diff --git a/itenium-socks/src/app/sock-card/sock-card.component.ts b/itenium-socks/src/app/sock-card/sock-card.component.ts new file mode 100644 index 0000000..7b79ebf --- /dev/null +++ b/itenium-socks/src/app/sock-card/sock-card.component.ts @@ -0,0 +1,16 @@ +import {Component, Input} from '@angular/core'; +import { Sock } from '../socks/sock.model'; // adjust the import path to your Sock model +import {RouterLink} from '@angular/router'; // new import + +@Component({ + selector: 'app-sock-card', + standalone: true, + imports: [ + RouterLink + ], + templateUrl: './sock-card.component.html', + styleUrl: './sock-card.component.scss' +}) +export class SockCardComponent { + @Input() sock!: Sock; +} diff --git a/itenium-socks/src/app/socks/shop.component.html b/itenium-socks/src/app/socks/shop.component.html index a0139e2..aef0839 100644 --- a/itenium-socks/src/app/socks/shop.component.html +++ b/itenium-socks/src/app/socks/shop.component.html @@ -5,22 +5,9 @@

Our Socks

-
- diff --git a/itenium-socks/src/app/socks/sock.component.html b/itenium-socks/src/app/socks/sock.component.html index b40f9d2..3b638c0 100644 --- a/itenium-socks/src/app/socks/sock.component.html +++ b/itenium-socks/src/app/socks/sock.component.html @@ -17,18 +17,7 @@
-
-
- -
-
-
{{ sock.name }}
-
{{ sock.price }}
-
-
- -
-
+

{{ sock.name }}