25 lines
695 B
TypeScript
25 lines
695 B
TypeScript
import { Component } from '@angular/core';
|
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
|
|
import { ICategoria } from '../categoria.model';
|
|
import { CategoriaService } from '../service/categoria.service';
|
|
|
|
@Component({
|
|
templateUrl: './categoria-delete-dialog.component.html',
|
|
})
|
|
export class CategoriaDeleteDialogComponent {
|
|
categoria?: ICategoria;
|
|
|
|
constructor(protected categoriaService: CategoriaService, protected activeModal: NgbActiveModal) {}
|
|
|
|
cancel(): void {
|
|
this.activeModal.dismiss();
|
|
}
|
|
|
|
confirmDelete(categoria: ICategoria): void {
|
|
this.categoriaService.delete(categoria.id!).subscribe(() => {
|
|
this.activeModal.close('deleted');
|
|
});
|
|
}
|
|
}
|