I open my modal with this
(click)="openVerticallyCentered(content)"
import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
openVerticallyCentered(content) {
this.modalService.open(content);
}
login(){
this.authService.signinUser(this.userLogin.email, this.userLogin.password).then(response => {
console.log(response);
this.toastr.success('Login Success .!!');
this.activeModal.close(); // <-- calling .close() method when user login successfully but its not close
})
}
Which is working fine. But I need to close it by button. It's closing from html like this (click)="modal.dismiss('Cross click')"
But I need to close it from .ts file.
I try with this.modalService.close();
But it says close is not a type of modelService. Any solution ?