7.0.0-rc.1
any
https://stackblitz.com/edit/angular-efvfiu?file=src/app/app.component.ts
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);
setTimeout(() => {
return false;
}, 1000);
}).catch(() => console.log('Oops errors!'))
});
when I return false, the [loading status] in OK button should be removed and back to normal status
always loading
@xiehongyang Must be call resolve() in setTimeout if you hope closed.
@xiehongyang Must be call
resolve()insetTimeoutif you hope closed.
yes, I know that, both resolve() and reject() can close the modal, but now If I want keep the Modal open, I pass return false to stop the Modal close, the loading in button OK can't be removed, how could I remove the loading in that button
resolve(false)
resolve(false)
@cipchk 这个好像没用,modal框还是会消失
@St-Yukio 你方法里是promise吗,我试过了,是可以阻止 modal框关闭的
@St-Yukio 你方法里是promise吗,我试过了,是可以阻止 modal框关闭的
@xiehongyang 我知道原因了 谢谢...
Most helpful comment
resolve(false)