Reputation: 4098
How is one able to use interpolation within a two-way binding style applied?
[style.backgroundImage]="'url(' + images/{{image}} + ')'"
Where the {{image}}
input interpolation spits out a lot of errors regarding expected expression
and etc.
Upvotes: 2
Views: 435
Reputation: 657148
[style.backgroundImage]="'url(\'images/' + image + '\')'"
You never use [prop]=
together with {{}}
. Either []
or `{{}}
You can also try
style.backgroundImage="'url(' + images/{{image}} + ')'"
I never tried if style bindings work without []
Upvotes: 3