The Scenario:
I have an element in my Angular app that I want to add a background image to. At the moment I have this:
<div class={{background-class}}></div>
where background-class is, for example, "background-style-1", which is in my stylesheet like this:
background-style-1 {
background-image: url(../../../../assets/images/contextmenu/person.png);
}
The element successfully displays the image, and if I query it, it shows this:

The Problem:
I don't want to hard-code all the background image URLs into my stylesheet. Instead, I want to just pass the URL into the HTML tag.
What I've Tried
<div style="background-image: url(../../../../assets/images/contextmenu/person.png)"></div>
This fails to display the image, and when I query the element, it shows this:
What I Want To Know:
Why does passing the image URL as an inline style property not work, and how can I make it work?
