這是我的代碼:角(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