first commit

This commit is contained in:
Dhanraj
2024-09-22 10:21:52 +05:30
parent 9c6c3abc32
commit bd5119fc3c
697 changed files with 112184 additions and 10841 deletions

View File

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, FormArray, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { EventService } from 'src/app/service/event.service';
@Component({
selector: 'app-event',
@ -6,13 +9,21 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./event.component.css']
})
export class EventComponent implements OnInit {
events: any[] = []; // Define the type according to your model
constructor() { }
htmlContent: string = '';
constructor(private eventService: EventService, private router: Router) { }
ngOnInit(): void {
this.loadEvents();
}
}
loadEvents(): void {
this.eventService.getEvents().subscribe(events => this.events = events);
}
deleteEvent(id: number): void {
if (confirm('Are you sure you want to delete this event?')) {
// this.eventService.deleteEvent(id).subscribe(() => this.loadEvents());
}
}
}