Reputation:
The question is: How do I modify my below snippet to work? :)
HTML
<div [ngStyle]="{'background-image': 'url(' + image.imageurl | async + ')'}">
Error
Parser Error: Missing expected }
I'm not entirely sure where that's supposed to go.
Thank you.
Upvotes: 6
Views: 6947
Reputation: 5374
Adding brackets will be helped, because you are trying call async pipe on 'url(' + image.imageurl
Try in this way:
<div [ngStyle]="{'background-image': 'url(' + (image.imageurl | async) + ')'}">
Upvotes: 10