小编Vai*_*van的帖子

ngbModal作为通用的Confrimation Box

我正在尝试使用ngbmodal创建通用确认框,它将在整个应用程序中使用.其中,标题和消息将从调用组件传递给模态.我创建了一个DialogService并添加到entryComponents中.现在我可以显示确认框.但是无法得到结果.下面是显示ConfirmationBox组件的代码.如何从中获取价值

    const modalRef = this.modalService.open(ConfirmationBoxComponent,{backdrop:"static"})
    modalRef.componentInstance.name = "Message";
    modalRef.componentInstance.confirmationBoxTitle = "Confirmation?"
    modalRef.componentInstance.confirmationmessage = "Do you want to cancel?"
    modalRef.componentInstance.changeRef.markForCheck();
Run Code Online (Sandbox Code Playgroud)

ng-bootstrap angular

9
推荐指数
1
解决办法
3958
查看次数

标签 统计

angular ×1

ng-bootstrap ×1