Is it possible to make a style background-image binding?
I tried this code:
<div data-bind="foreach: itemList">
<div data-bind="style: { background-image: 'url:(temp.png)' }">some text</div>
</div>
I also tried backgroundImage, without quotes in url, without : after url, but it’s still not working. All the others, like color or backgroundColor bindings are working perfectly.
As stated in the documentation, you need to use the Javascript name for the style you want to control.
This means that you would have to use
backgroundImageinstead ofbackground-image.Something like this: