Skip to content

In Ivy, pipes uses providers from a host component where ViewEngine did not #36146

@EmaGht

Description

@EmaGht

🐞 bug report

Affected Package

@angular/core

Is this a regression?

Yes, works without ivy

Description

I think it's related to this #34227 but i'm not really sure.
What i have is a component let's say component1 that passes an Input to another component component2 and component2shows it as-is.
The problem is that this input gets transformed by a pipe that retrieves via injector the informations to transform this Input. This informations is stored component-wise. component2 also provides it, but for his own data.
Unfortunately, the pipe in question, used in the template of component1 ends up using the dependency declared in component2, probably because the execution gets delegated after change detection has been run, therefore the context of the pipe changes

I'm not honestly sure my English is good enough to explain this properly but luckily i have a repro

🔬 Minimal Reproduction

repo: https://github.com/EmaGht/ivypipe
ng-run version: https://ng-run.com/edit/32k314W605UdYOdVEPCE
Steps:
git clone https://github.com/EmaGht/ivypipe.git
cd ivypipe
npm install
ng serve
check out the on-screen debug informations

For now i think i can work around it telling the pipe explicitly which context should be used but... meh

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions