fix(ivy): inconsistent value returned by DebugNode.context (#31442)
Fixes Ivy's return value for `DebugNode.context` not being consistent for the case where there is both a structural directive and a component on a node. In `ViewEngine` the instance of the component would be returned, whereas in Ivy the context of the directive is returned. Also adds a couple of extra test cases for how `DebugNode.context` deals with directives. This PR resolves FW-1343. PR Close #31442
This commit is contained in:
@ -220,7 +220,9 @@ class DebugNode__POST_R3__ implements DebugNode {
|
||||
return nativeElement &&
|
||||
(getComponent(nativeElement as Element) || getViewComponent(nativeElement));
|
||||
}
|
||||
get context(): any { return getContext(this.nativeNode as Element); }
|
||||
get context(): any {
|
||||
return getComponent(this.nativeNode as Element) || getContext(this.nativeNode as Element);
|
||||
}
|
||||
|
||||
get listeners(): DebugEventListener[] {
|
||||
return getListeners(this.nativeNode as Element).filter(isBrowserEvents);
|
||||
|
Reference in New Issue
Block a user