I have multiple slides and when 1 is selected I want to add border color to it and when the other slide is selected, the border color is then added to the new slide and removed from the other.
public desktopConfig: SwiperOptions = {
slidesPerView: 3.5,
navigation: false,
breakpoints: {
0: {
allowTouchMove: true
},
768: {
allowTouchMove: false
}
}
I don't want to use jquery, and add the border color when one is selected and remove from the previous one.
I was thinking too much, I just made a div inside swiper tag and gave a condition to add a class to it onselect.
<swiper [config]="desktopConfig" class="mySwiper">
<ng-container *ngFor="let param of data">
<ng-template swiperSlide>
<div (click)="selectB(param)"
[class.active]="isSelected">
<img [src]="">
<div>
{{param.title}}
</div>
</div>
</ng-template>
</ng-container>
</swiper>