github.com/readium/readium-lcp-server@v0.0.0-20240101192032-6e95190e99f1/frontend/manage/app/dashboard/dashboard-info.component.ts (about) 1 import { Component } from '@angular/core'; 2 import { DashboardInfo, DashboardBestSeller } from './dashboardInfo'; 3 import { DashboardService } from './dashboard.service'; 4 5 @Component({ 6 moduleId: module.id, 7 selector: 'lcp-frontend-dashboard-info', 8 templateUrl: './dashboard-info.component.html' 9 }) 10 11 export class DashboardInfoComponent { 12 infos: DashboardInfo; 13 bestSellers: DashboardBestSeller[]; 14 15 ngOnInit(): void { 16 this.refreshInfos(); 17 } 18 19 constructor(private dashboardService: DashboardService) { 20 21 } 22 23 refreshInfos() 24 { 25 this.dashboardService.get().then( 26 infos => { 27 this.infos = infos; 28 } 29 ); 30 this.dashboardService.getBestSeller().then( 31 bestSellers => { 32 this.bestSellers = bestSellers; 33 } 34 ); 35 36 } 37 }