这是我的代码:角(2/4)modalService.close()不工作
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
constructor(private http: Http, private route: ActivatedRoute,private router: Router, private modalService: NgbModal) { }
editDocumentRow = function (documentId, modal) {
this.http.get(ConstantComponent.url + '/documentmanagerapi/Get/' + documentId).map((res: Response) => res.json()).subscribe(data => {
this.documentsRowDetails = data
this.modalService.open(modal)
this.modalService.close() // not working
})
}
我想在不同的功能使用this.modalService.close()
。但它甚至不在this.modalService.open(modal)
完美运行的相同功能中工作。
我收到此错误: this.modalService.close is not a function
任何建议,有什么错在这里去了?
modalService.close()将无法正常工作,而不是使用this.activeModal.dismiss() – Chandru