35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { Component, OnInit, inject } from '@angular/core';
|
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
import { Observable } from 'rxjs';
|
|
import { PublicationListComponent } from '../../components/publication-list/publication-list.component';
|
|
import { Publication } from '../../core/rest-services/publications/model/publication';
|
|
import { HomeService } from './home.service';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
@Component({
|
|
selector: 'app-home',
|
|
imports: [
|
|
CommonModule,
|
|
MatProgressSpinnerModule,
|
|
PublicationListComponent
|
|
],
|
|
templateUrl: './home.component.html',
|
|
styleUrl: './home.component.scss',
|
|
providers: [HomeService]
|
|
})
|
|
export class HomeComponent implements OnInit {
|
|
private homeService = inject(HomeService);
|
|
|
|
get isLoading$(): Observable<boolean> {
|
|
return this.homeService.isLoading$;
|
|
}
|
|
|
|
get publications$(): Observable<Publication[]> {
|
|
return this.homeService.publications$;
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
this.homeService.startLatestPublicationsRetrieving();
|
|
}
|
|
}
|