I\'ve got a modal:
To open the modal
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
modalReference = null;
constructor(private modalService: NgbModal) {
}
openVerticallyCentered(content) {
this.modalReference = this.modalService.open(content, { centered: true });
}
to close the modal using the reference, like Amit said
this.modalReference.close();
source:https://ng-bootstrap.github.io/#/components/modal/examples