Checkpoint

This commit is contained in:
aditya.chandel
2024-12-15 22:41:13 -07:00
parent 0aa1c1b923
commit 767c6604e8
51 changed files with 297 additions and 212 deletions
@@ -0,0 +1,47 @@
import {Component, computed, OnInit} from '@angular/core';
import {AppMenuitemComponent} from './app.menuitem.component';
import {NgForOf, NgIf} from '@angular/common';
import {MenuModule} from 'primeng/menu';
import {LibraryService} from '../../service/library.service';
import {Library} from '../../model/library.model';
@Component({
selector: 'app-menu',
imports: [AppMenuitemComponent, NgIf, NgForOf, MenuModule],
templateUrl: './app.menu.component.html',
})
export class AppMenuComponent implements OnInit {
home: any[] = [];
libraries: any;
libraryMenu = computed(() => [
{
label: 'Library',
separator: false,
items: this.libraries().map((lib: Library) => ({
label: lib.name,
icon: 'pi pi-fw pi-home',
routerLink: [`/library/${lib.id}/books`]
})),
},
]);
constructor(private libraryService: LibraryService) {
this.libraries = this.libraryService.libraries;
}
ngOnInit() {
this.populateHome();
}
private populateHome() {
this.home = [
{
label: 'Home',
items: [
{label: 'Dashboard', icon: 'pi pi-fw pi-home', routerLink: ['/']},
],
},
];
}
}