Adding a confirmation before deletion
This commit is contained in:
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CrudService } from '../crud.service'
|
||||
import {BehaviorSubject, NotFoundError} from "rxjs";
|
||||
import { CrudFormlyJsonschemaService } from "../crud-formly-jsonschema.service";
|
||||
import {NgbModal} from "@ng-bootstrap/ng-bootstrap";
|
||||
|
||||
@Component({
|
||||
selector: 'crud-card',
|
||||
@@ -44,6 +45,7 @@ export class CardComponent implements OnInit {
|
||||
private formlyJsonschema: CrudFormlyJsonschemaService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private modalService: NgbModal,
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -99,7 +101,18 @@ export class CardComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
onDuplicate() {
|
||||
|
||||
}
|
||||
|
||||
isCreateForm() {
|
||||
return this.resource_id === null;
|
||||
}
|
||||
|
||||
open(content: any) {
|
||||
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then(
|
||||
(result) => { this.onDelete() },
|
||||
(reason) => {},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user