Angular – How to close modal popup window on click of submit button in angular (without using data-dismiss modal of bootstrap code)

angular

How do I close Modal Popup on form submit?

enter image description here

Best Answer

If you are using ng-bootstrap to create modal, you can declare modalservice in constructor and close function will work.

constructor(private modalService: NgbActiveModal){}

    public onClick(id: number): void{
        this.modalService.close();
        //Your code goes here
    }

If you are following different logic for modal window. Please post some of you code so that any one give you better solution.

Related Topic