本文整理汇总了TypeScript中ng-zorro-antd.NzModalService.confirm方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NzModalService.confirm方法的具体用法?TypeScript NzModalService.confirm怎么用?TypeScript NzModalService.confirm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ng-zorro-antd.NzModalService
的用法示例。
在下文中一共展示了NzModalService.confirm方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: showConfirm
showConfirm(): void {
this.modalService.confirm({
nzTitle : '<i>Do you Want to delete these items?</i>',
nzContent: '<b>Some descriptions</b>',
nzOnOk : () => console.log('OK')
});
}
示例2: showConfirm
showConfirm(): void {
this.confirmModal = this.modal.confirm({
nzTitle: 'Do you Want to delete these items?',
nzContent: 'When clicked the OK button, this dialog will be closed after 1 second',
nzOnOk: () => new Promise((resolve, reject) => {
setTimeout(Math.random() > 0.5 ? resolve : reject, 1000);
}).catch(() => console.log('Oops errors!'))
});
}
示例3: _click
@HostListener('click')
_click() {
this.confirmServ.confirm({
title: 'Make sure clear all local storage?',
onOk: () => {
localStorage.clear();
this.messageServ.success('Clear Finished!');
}
});
}
示例4: showDeleteConfirm
showDeleteConfirm(): void {
this.modalService.confirm({
nzTitle : 'Are you sure delete this task?',
nzContent : '<b style="color: red;">Some descriptions</b>',
nzOkText : 'Yes',
nzOkType : 'danger',
nzOnOk : () => console.log('OK'),
nzCancelText: 'No',
nzOnCancel : () => console.log('Cancel')
});
}
示例5: Observable
return new Observable((observer) => {
this.confirmSrv.confirm({
title: '确认要离开吗?',
content: '你已经填写了部分表单离开会放弃已经填写的内容。',
okText: '离开',
cancelText: '取消',
onOk: () => {
observer.next(true);
observer.complete();
},
onCancel: () => {
observer.next(false);
observer.complete();
}
});
});