ChangeDetectorRef in Pipe used in Input resolves to wrong Components Instance #38883
Labels
freq2: medium
regression
Indicates than the issue relates to something that worked in a previous version
state: confirmed
state: has PR
type: bug/fix
Milestone
馃悶 bug report
Is this a regression?
The same code worked for me in 9.x
Description
I'm using ChangeDetectorRef in one of my Pipes. When used in the Input of a custom Component, CHangeDetectorRef resolves to that component instead of the hosts template.
The FnCallPipe gets the folowing ChangeDetectorRef:
As you can also see (L156), the code is generated as
傻傻directiveInject(ChangeDetectorRef)
instead of傻傻injectPipeChangeDetectorRef()
馃敩 Minimal Reproduction
https://stackblitz.com/edit/angular-ivy-8x6a4f
You can see, it works with uncompiled code, but not with the included library ngx-function-expression, which uses cdRef exactly like the TestPipe. Thus, the compilation/ngcc process of the library causes this issue.
馃實 Your Environment
Angular Version:
Related Issues
#33677 (closed and fixed)
The text was updated successfully, but these errors were encountered: