javascript - Zone.js 将错误的 currentZone 值传递给 onInvoke Hook

标签 javascript angularjs zone.js

那里。

根据 ZoneSpec 接口(interface)的注释(位于 zone.ts 文件中),onInvoke 钩子(Hook)必须接收 currentZone 作为第二个参数。如果我创建拦截器区域,则对该区域的引用应作为第二个参数传递。

以下是文档摘录:

/* Allows interception of the callback invocation.
@param parentZoneDelegate Delegate which performs the parent [ZoneSpec] operation.
@param currentZone The current [Zone] where the current interceptor has beed declared.
@param targetZone The [Zone] which originally received the request.
@param delegate The argument passed into the run method.
@param applyThis The argument passed into the run method.
@param applyArgs The argument passed into the run method.
@param source The argument passed into the run method.
*/
onInvoke?:
    (parentZoneDelegate: ZoneDelegate, currentZone: Zone, targetZone: Zone, delegate: Function,
     applyThis: any, applyArgs: any[], source: string) => any;

我创建了一个interceptZone,我想它应该作为当前区域传递给我的钩子(Hook)方法。但由于某种原因,我收到与 targetZone 相同的值。 我创建了一个演示HERE ,它描述了所描述的问题。

我错过了什么吗?

最佳答案

这是库中的一个错误。开发商证实了这一点。 详情为HERE

关于javascript - Zone.js 将错误的 currentZone 值传递给 onInvoke Hook ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41103946/

相关文章:

javascript - 是否可以将元素恢复到其先前的位置而不将位置作为参数传递?

javascript - 触发或模拟哈希点击

javascript - 使用 Angular JS 编辑表格单元格的更好方法

javascript - Angular 4、zone.js 和 javascript 库的自定义事件

angular - 在测试中使用 fakeAsync 会导致 Angular 4 和 Zone.js 出错

javascript - 通过 ID 为表创建一个自动粗体 ??用javascript

javascript - Angular 模态实例无法读取 DOM 元素

javascript - 为什么在 $rootScope.$on 中需要 $rootScope.$apply?

javascript - 拖放功能不适用于 Angular js

javascript - 将 Handsontable 添加到 Angular-CLI 脚本时 ZoneAwarePromise 被覆盖