1
に誤ったcurrentZone値を渡しています。Zone.jsがonInvokeフック
zoneSpecインターフェイス(zone.tsファイルにあります)に関するコメントによれば、onInvokeフックはcurrentZoneを第2パラメータとして受け取る必要があります。インターセプタゾーンを作成すると、そのゾーンへの参照を第2パラメータとして渡す必要があります。ここで
は、ドキュメントからの抜粋です。
/* 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を、作成しました。しかし何らかの理由で私はtargetZoneと同じ値を受け取ります。 説明した問題を示すデモHEREを作成しました。
何か不足していますか?