0

I have a delete button on the table when user click delete button basically I would like to ask confirmation from the user for delete. If use clicked yes I need to make service call. I'm facing an issue when I making service call. Below is my code and I have attached the error as well.

delete (id) {
    this.modalRef = this.modalService.show(ConfirmationModalComponent);
    this.modalRef.content.onClose.subscribe(result => {
        if (result === true) {
            this.userService.deleteUser(id).subscribe(response => {
                alert("Record deleted successfully");
            });
        }
    });
} 

enter image description here

Gabriel Bleu
  • 9,703
  • 2
  • 30
  • 43
Velkumar
  • 446
  • 1
  • 8
  • 20

0 Answers0