【发布时间】:2022-11-29 19:51:46
【问题描述】:
我正在使用ng-bootstrap模态
从“@ng-bootstrap/ng-bootstrap”导入{NgbModal,ModalDismissReasons};
在按钮上单击它被正确打开
<button class="btn labelbtn accountbtn customnavbtn"(click)="demobutton(UploadModal)" type="button"> Open </button>
demobutton(UploadModal:any) {
this.modalService
.open(UploadModal, {
windowClass: "modal",
ariaLabelledBy: "modal-basic-title",
backdrop: false,
})
.result.then(
(result) => {},
(reason) => {}
);
}
但是当我尝试通过功能打开时,它没有正确打开,只有一些 div 可见,内容不可见。
async open(files){
this.modalService.dismissAll();
setTimeout(() => {
this.demobutton('UploadModal');
}, 2000);
任何解决方案谢谢
【问题讨论】:
标签: angular typescript ng-bootstrap ng-bootstrap-modal