Ts
Ts
@Component({
selector: 'app-leave-application',
templateUrl: './leave-application.component.html',
styleUrls: ['./leave-application.component.css']
})
export class LeaveApplicationComponent implements OnInit {
leaveForm: FormGroup;
content?: string;
username?: string;
leaveSubmitted: boolean = false;
}
ngOnInit(): void {
this.username = this.storageService.getUser().username; // Adjust this based on
your storage service
this.userService.getUserBoard().subscribe({
next: data => {
this.content = data;
},
error: err => {
console.error('Error:', err);
}
});
}
applyLeave() {
Swal.fire({
icon: 'success',
title: 'Leave Application Submitted',
text: 'Your leave application has been submitted successfully!',
});
}
);
}
this.leaveForm.reset();
}