Error. No provider for _SlickCarouselComponent found in NodeInjector. Angular 17

34 Views Asked by At

I have Angular: 17.2.0 application. I want use ngx-slick-carousel: ^17.0.0, I have already download all dependencies for this library, I follow to instruction, but I still have issue.

enter image description here

This error appears when I use ngxSlickItem directive in parent component.

Child component code (app-carousel-section):

<ngx-slick-carousel #slickModal="slick-carousel" [config]="carouselConfig">
  <ng-content></ng-content>
</ngx-slick-carousel>

Parent component code:

<app-carousel-section>
  <app-product-card ngxSlickItem [countActiveStars]="3"></app-product-card> <!-- The error appears when I add directive here -->
  <app-product-card [countActiveStars]="3"></app-product-card> <!-- Works, but slider doesnt see it -->
</app-carousel-section>

UPD: StackBlitz: https://stackblitz.com/edit/stackblitz-starters-uiv5ea?file=src%2Fapp%2Fchild%2Fchild.component.ts

0

There are 0 best solutions below