Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions itenium-socks/src/app/home/latest-socks.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@ <h2>
</div>
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3" *ngFor="let sock of socks$ | async">
<div class="box">
<a href="/socks/{{ sock.id }}">
<div class="img-box">
<img src="sock-images/Socks-{{ sock.brand }}-{{ sock.variant }}.png" />
</div>
<div class="detail-box">
<h6>{{ sock.name }}</h6>
<h6><span>{{ sock.price }}</span></h6>
</div>
<div class="new">
<span class="favourite" [style.color]="sock.color"><i class="fa fa-star"></i></span>
</div>
</a>
</div>
<app-sock-card [sock]="sock"></app-sock-card>
</div>
</div>
<div class="btn-box">
Expand Down
3 changes: 2 additions & 1 deletion itenium-socks/src/app/home/latest-socks.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { Observable } from 'rxjs';
import { Sock } from '../socks/sock.model';
import { AsyncPipe, NgFor } from '@angular/common';
import { RouterLink } from '@angular/router';
import { SockCardComponent } from '../socks/sock-card/sock-card.component';

@Component({
selector: 'app-latest-socks',
standalone: true,
imports: [NgFor, AsyncPipe, RouterLink],
imports: [NgFor, AsyncPipe, RouterLink, SockCardComponent],
templateUrl: './latest-socks.component.html'
})
export class LatestSocksComponent implements OnInit {
Expand Down
15 changes: 1 addition & 14 deletions itenium-socks/src/app/socks/shop.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@ <h2>
</div>
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3" *ngFor="let sock of socks$ | async">
<div class="box">
<a href="/socks/{{ sock.id }}">
<div class="img-box">
<img src="sock-images/Socks-{{ sock.brand }}-{{ sock.variant }}.png" />
</div>
<div class="detail-box">
<h6>{{ sock.name }}</h6>
<h6><span>{{ sock.price }}</span></h6>
</div>
<div class="new">
<span class="favourite" [style.color]="sock.color"><i class="fa fa-star"></i></span>
</div>
</a>
</div>
<app-sock-card [sock]="sock"></app-sock-card>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion itenium-socks/src/app/socks/shop.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { SocksService } from './socks.service';
import { Observable } from 'rxjs';
import { Sock } from './sock.model';
import { AsyncPipe, NgFor } from '@angular/common';
import { SockCardComponent } from './sock-card/sock-card.component';

@Component({
selector: 'app-shop',
standalone: true,
imports: [NgFor, AsyncPipe],
imports: [NgFor, AsyncPipe, SockCardComponent],
templateUrl: './shop.component.html'
})
export class ShopComponent {
Expand Down
14 changes: 14 additions & 0 deletions itenium-socks/src/app/socks/sock-card/sock-card.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="box">
<a href="/socks/{{ sock.id }}">
<div class="img-box">
<img src="sock-images/Socks-{{ sock.brand }}-{{ sock.variant }}.png" />
</div>
<div class="detail-box">
<h6>{{ sock.name }}</h6>
<h6><span>{{ sock.price }}</span></h6>
</div>
<div class="new">
<span class="favourite" [style.color]="sock.color"><i class="fa fa-star"></i></span>
</div>
</a>
</div>
12 changes: 12 additions & 0 deletions itenium-socks/src/app/socks/sock-card/sock-card.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component, Input } from '@angular/core';
import { Sock } from '../sock.model';

@Component({
selector: 'app-sock-card',
standalone: true,
imports: [],
templateUrl: './sock-card.component.html'
})
export class SockCardComponent {
@Input() sock!: Sock;
}
13 changes: 1 addition & 12 deletions itenium-socks/src/app/socks/sock.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,7 @@
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6">
<div class="box">
<div class="img-box">
<img src="/sock-images/Socks-{{ sock.brand }}-{{ sock.variant }}.png" />
</div>
<div class="detail-box">
<h6>{{ sock.name }}</h6>
<h6><span>€</span><span>{{ sock.price }}</span></h6>
</div>
<div class="new">
<span class="favourite" [style.color]="sock.color"><i class="fa fa-star"></i></span>
</div>
</div>
<app-sock-card [sock]="sock"></app-sock-card>
</div>
<div class="col-sm-6 col-md-6 col-lg-6">
<h1 style="margin-top: 25px;">{{ sock.name }}</h1>
Expand Down
3 changes: 2 additions & 1 deletion itenium-socks/src/app/socks/sock.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { Observable } from 'rxjs';
import { Sock } from './sock.model';
import { SocksService } from './socks.service';
import { AsyncPipe, NgIf, TitleCasePipe } from '@angular/common';
import { SockCardComponent } from './sock-card/sock-card.component';

@Component({
selector: 'app-sock',
standalone: true,
imports: [NgIf, AsyncPipe, TitleCasePipe],
imports: [NgIf, AsyncPipe, TitleCasePipe, SockCardComponent],
templateUrl: './sock.component.html'
})
export class SockComponent {
Expand Down