Create carousel from variable with Angular ngFor

I need to create a Bootstrap 4 carousel with pictures from a variable pics in the .ts file. I have used the following static carousel code:

 <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
        <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
        <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
        <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
    </ol>
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img src="assets/fortress.jpg" class="d-block w-100 carousel-pic" alt="...">
        </div>
        <div class="carousel-item">
            <img src="assets/fortress.jpg" class="d-block w-100 carousel-pic" alt="...">
        </div>
    </div>
</div>

I updated the code to include an *ngFor loop as follows:

   <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
        </ol>
        <div class="carousel-inner">
            <div class="carousel-item active">
                <img src="http://MYURL/public/PinPhotos/{{item?.pin_photos[0].url}}"
                    class="d-block w-100 carousel-pic" alt="...">
            </div>
            <div *ngFor="let pic of pics">
                <div class="carousel-item">
                    <img src="http://MYURL/public/PinPhotos/{{pic.url}}" class="d-block w-100 carousel-pic" alt="...">
                </div>
            </div>
        </div>
    </div>

However, the carousel is not displaying correctly. The active slide shows the first picture, but the second slide displays the same picture, and the carousel stops, not displaying the third picture. I need help to understand what I am missing.

The issue with the updated code is that the *ngFor loop is creating a new div for each picture, which is not the intended behavior for a bootstrap carousel. To fix this issue, move the *ngFor loop inside the carousel-inner div, and remove the extra div that is being created for each picture. The correct code should look like this:

   <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
        </ol>
        <div class="carousel-inner">
            <div class="carousel-item active">
                <img src="http://MYURL/public/PinPhotos/{{item?.pin_photos[0].url}}"
                    class="d-block w-100 carousel-pic" alt="...">
            </div>
            <div *ngFor="let pic of pics" class="carousel-item">
                <img src="http://MYURL/public/PinPhotos/{{pic.url}}" class="d-block w-100 carousel-pic" alt="...">
            </div>
        </div>
    </div>

This should correctly display all the pictures in the carousel.