Skip to content
Discussion options

You must be logged in to vote

nzOnOk 返回的 Promise 在 setTimeout 中异步 resolve 时,loading 状态更新发生在 Angular zone 之外,导致变更检测不触发。解决方案:1) 确保导入了 zone.js;2) 对于 zoneless 应用,注入 ChangeDetectorRef 并在 resolve 后调用 this.cdr.detectChanges();3) 或者使用 this.ngZone.run(() => resolve(false)) 包装 resolve 调用。

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vm0100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants