Open ManuelRauber opened 1 year ago
@ManuelRauber did you find a solution for this problem? still having the same issue
@ManuelRauber did you find a solution for this problem? still having the same issue
Well, I ended up duplicating stuff a bit, unfortunately.
I found good example of how to fix the issue in the template with ng-content here https://github.com/angular/components/issues/15277
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I want to create a component that does support virtual scrolling but can be turned off. To do so, I want to use some ng-templates so I do not have to redefine things like headers, item template, etc.
The code for that (minimalistic, without turn on/off virtual scrolling) looks like:
As you can see, I have
Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-sjp7es?file=src%2Fmain.ts
I've also attached a Zip-File with a working sample, because for whatever reason the StackBlitz does not load the DevServer sometimes, maybe they have a hiccup.
Steps to reproduce:
ng-container
containing thecdkVirtualFor
you will see, thatmy-test
components outputs true, because it has an injector containing a CdkVirtualScrollViewportExample.zip
Expected Behavior
I would expect it to work and CdkVirtualFor actually sees the CdkVirtualScrollViewport, because it is in the Injector, as
my-test
component reports.Actual Behavior
Error pops up with:
Environment