How to close ngbootstrap model along with form submission inside the model window. I am using angular 6.
Asked
Active
Viewed 212 times
0
-
3Possible duplicate of [How to programatically close ng-bootstrap modal?](https://stackoverflow.com/questions/40382319/how-to-programatically-close-ng-bootstrap-modal) – Fuzzybear Jul 23 '18 at 10:56
1 Answers
0
In the submit button, call the close function
<button (click)="d('Cross click')">Submit</button>
Or bind it with submit event
import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
....
constructor(private modalService: NgbModal) {}
submit() {
const modalRef = this.modalService.close(NgbdModalContent);
}

Debojyoti
- 4,503
- 3
- 19
- 27