【发布时间】:2017-09-22 12:44:57
【问题描述】:
我正在尝试使用 ngbmodal 创建通用确认框,它将在整个应用程序中使用。其中,Title 和 message 将从调用组件传递给 modal。我创建为 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();
【问题讨论】:
标签: angular ng-bootstrap