I am creating a web application with Angular 4 and Bootstrap 4 beta. I need to pause the carousel when a user clicks on an image to display a modal, and then resume the carousel once the modal is closed. However, I have encountered an issue where changing the attributes of the carousel does not reflect in the behavior. Here is my HTML code:
<div #carousel id="carouselControls" class="carousel slide" data-ride="carousel" [attr.data-interval]="interval">
<div class="carousel-inner" role="listbox">
<div *ngFor="let image of images, let i = index" class="carousel-item" [ngClass]="{'active' : i == 0}">
<img data-toggle="modal" data-target="#imageModal" (click)="zoom(image)" [src]="image">
</div>
</div>
<a class="carousel-control-prev" href="#carouselControls" role="button" data-slide="prev">
<span class="fa fa-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselControls" role="button" data-slide="next">
<span class="fa fa-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
Even after changing the interval
property in my component from 5000 to 'false', the carousel does not seem to update accordingly. My question is: How can I toggle this using Typescript?