30 lines
719 B
TypeScript
30 lines
719 B
TypeScript
import {Component, OnInit} from '@angular/core';
|
|
import {ApiService} from '../../services/api/api.service';
|
|
import {Event} from '../../models/event';
|
|
|
|
@Component({
|
|
selector: 'app-landingpage',
|
|
templateUrl: './landingpage.component.html',
|
|
styleUrls: ['./landingpage.component.css']
|
|
})
|
|
export class LandingpageComponent implements OnInit {
|
|
events: Event[] = [];
|
|
eventCount: number = 0;
|
|
|
|
constructor(
|
|
private apiService: ApiService
|
|
) {
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
this.getEvents();
|
|
}
|
|
|
|
getEvents() {
|
|
this.apiService.getEvents('2021-10-04').subscribe(events => {
|
|
this.events = events;
|
|
this.eventCount = events.length;
|
|
});
|
|
}
|
|
}
|