epasmed/src/main/webapp/app/entities/leaves/leaves-delete-dialog.compon...

28 lines
801 B
TypeScript
Executable File

import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { JhiEventManager } from 'ng-jhipster';
import { Leaves } from './leaves.model';
import { LeavesService } from './leaves.service';
@Component({
selector: 'jhi-leaves-delete-dialog',
templateUrl: './leaves-delete-dialog.component.html',
})
export class LeavesDeleteDialogComponent {
leaves?: Leaves;
constructor(private leavesService: LeavesService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {}
cancel(): void {
this.activeModal.dismiss();
}
confirmDelete(id: string): void {
this.leavesService.delete(id).subscribe(() => {
this.eventManager.broadcast('leavesListModification');
this.activeModal.close();
});
}
}