update: icon mechanic
All checks were successful
Build and Push Docker Images / build-and-push-backend (push) Successful in 7s
Build and Push Docker Images / build-and-push-frontend (push) Successful in 15s

This commit is contained in:
2026-01-31 17:41:20 +01:00
parent be813ffbf0
commit fa86607af3
11 changed files with 367 additions and 29 deletions

View File

@@ -3,6 +3,7 @@ import { CommonModule } from '@angular/common';
import { MaterialModule } from '../../material.module';
import { Api } from '../../services/api';
import { Item } from '../../models/item';
import { IconService } from '../../services/icon.service';
import { Observable } from 'rxjs';
@Component({
@@ -16,7 +17,10 @@ export class HomeComponent implements OnInit {
items$!: Observable<Item[]>;
imgErrorMap = new Map<number, boolean>();
constructor(private apiService: Api) {}
constructor(
private apiService: Api,
private iconService: IconService
) {}
ngOnInit(): void {
this.items$ = this.apiService.getItems();
@@ -25,4 +29,8 @@ export class HomeComponent implements OnInit {
onImgError(itemId: number) {
this.imgErrorMap.set(itemId, true);
}
isMaterialIcon(iconUrl: string): boolean {
return this.iconService.isValidIcon(iconUrl);
}
}