Calendar_Frontend/src/app/components/events-table/events-table.component.ts

30 lines
702 B
TypeScript

import {Component, Input, OnInit} from '@angular/core';
import {Event} from '../../models/event';
import {UtilsService} from '../../services/utils.service';
@Component({
selector: 'app-events-table',
templateUrl: './events-table.component.html',
styleUrls: ['./events-table.component.css']
})
export class EventsTableComponent implements OnInit {
@Input() events: Event[] = [];
@Input() selectedCalendar: number = -1;
constructor() {
}
ngOnInit(): void {
}
addEvent() {
this.events.push({
calendarId: this.selectedCalendar,
startDateTime: new Date(),
endDateTime: new Date(),
createdDate: new Date(),
createdBy: UtilsService.getNameFromLocalStorage()
} as Event);
}
}