I have a couple of cards that pull data from an API and then loop over the data to display the cards in the front end. each card has an image associated to it that I'd like to set as a background image for each specific card.
<div *ngFor ='let package of packages; let i = index' [attr.data-index]="i">
<div class="card">
<div class="card-header" style="background-image:url("{{packages[i].destinations.image}}")">{{packages[i].destinations.destname}}</div>
<div class="price">{{packages[i].destinations.hotelrating}}</div>
</div>
</div>
this is obviously not working. i search on the forum but cannot find any method that shows how to handle setting background images for cards getting the data from an API