you can use the @viewChildren directive for select all cards.
Also I use a setTimeOut to call the function because the ngFor has a little delay In building the data in the html.
<divclass='card' *ngFor="let data of cardData" #card><div><img [src]="data.img"alt="Photography"></div><divclass="card-body"><h5>{{data.name}}</h5></div></div>
ScrollTrigger not working iin Angular
in GSAP
Posted
Hi @Sanjana you can try something like this on your ts component:
you can use the @viewChildren directive for select all cards.
Also I use a setTimeOut to call the function because the ngFor has a little delay In building the data in the html.
https://stackblitz.com/edit/angular-ivy-cpnzfx?file=src/app/app.component.ts