I've got a series of carousel-item
divs being repeated using *ngFor
. Now, I'm trying to figure out how to dynamically add the active
class to just the first div (carousel-item)
. Any suggestions on how to achieve this in Angular 7?
component.html
<div class="carousel-item" *ngFor="let testimonial of getTestimonial; let isFirst = first">
<p [ngClass]="{'active': isFirst}">{{testimonial.description}}</p>
<p class="font-weight-bold font-italic t-name">{{testimonial.name}} - {{testimonial.profession}}</p>
</div>