I have created this slider
Working link : https://stackblitz.com/edit/angular-ivy-gcgxgh?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html
HTML Component :
<div class="slideshow-container">
<ng-container>
<div class="mySlides animated fadeInRight">Slide 1</div>
<div class="mySlides animated fadeInRight">Slide 2</div>
</ng-container>
</div>
<button class="btn ansbtn" (click)="plusSlides(-1)">Previous</button>
<button class="btn ansbtn" (click)="plusSlides(1)">Next</button>
i have to call child component inside slider like
<ng-container *ngFor="let o of list; let i=index">
<child-component-1 *ngIf="i==0"> </child-component-1>
<child-component-2 *ngIf="i==1"> </child-component-2>
..
<child-component-n *ngIf="i==n"> </child-component-n>
</ng-container>
Getting this error on click of next button :
ERROR Error: Cannot read properties of undefined (reading 'className')
Any solution to call child component inside slider and fix the error, Thanks