2

これは私のコードです:

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

ここで何がうまくいかなかったのでしょうか?

4

2 に答える 2