I am using ngFor to display a list of posts, each of which should have a unique background image. The getBackgroundStyle function is responsible for extracting the URL of the image from the post array.
<div class="singlePost" *ngFor="let post of data" (click)="itemTapped($event, post)">
<div style="background-image: url('{{getBackgroundStyle(post)}}')">
<img src="{{getBackgroundStyle(post)}}">
Strangely, after building the code, the img tag displays correctly, but the div element loses its style attribute entirely.
Displayed output in lab/browser:
<div class="singlePost">
<div>
<img src="http://theurl.com">