【发布时间】:2021-09-17 12:15:48
【问题描述】:
确认对话框显示两次是什么情况? 或者其他方面,确认对话框显示两次是什么原因?
我有一个简单的对话框模板
<p-confirmDialog icon="fa fa-exclamation-triangle"
width="444"
[closable]="false"
key="uniqueidofdialog"
appendTo="body"
#dialogref>
<p-footer>
<button id="gemini_consentLockedByAnotherUser_btnOk"
type="button"
pButton
class="button-primary"
label="OK"
(click)="dialogref.accept()"></button>
</p-footer>
</p-confirmDialog>
private showConfirmDialog() {
this.confirmationService.confirm({
message: `Warning! blah-blah.`,
header: `Warning header`,
key: 'uniqueidofdialog',
accept: () => {
// TODO
}
});
}
当然 ComfirmationService 包含在模块的 provider 部分,而 ComfirmDialogModule 被导入到模块的 import 部分。 showConfirmDialog() 调用一次。
我错过了什么?
提前谢谢你
【问题讨论】:
标签: angular dialog primeng display