I've been attempting to dynamically load images into a carousel on my page, but I'm facing an issue with the code. Here's what I have so far:
<div id="carousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div *ngFor="let image of imagesList; let isFirst = first" class="carousel-item" [class.active]="isFirst">
<img class="d-block w-100" src="{{image}}" alt="slide">
</div>
</div>
</div>
The challenge is that most solutions I've come across involve using 'fs'. However, due to limitations in Angular 6 and the latest Angular CLI, we are unable to utilize features like 'fs' and 'os' in this version.
Currently, I am populating the list with images manually like this:
public imagesList = [
'../../../assets/img/home/DSC_0501.JPG',
'../../../assets/img/home/DSC_0211.JPG'
];
Would it be possible to create a function that automatically adds all images from a directory to this list? Are there any alternative approaches to achieve this?