Reputation: 327
Till the "style: {" the syntax is good, what is wrong with 2nd part ?
<div data-bind="attr: { 'style': 'position:relative; float:left; width: ' + width +
'; height: ' + height + ';} style: {border: $parent.foo() ? \'1px solid black\' : \'1px solid white\' }'">
Thanks in advance Cs
Upvotes: 1
Views: 504
Reputation: 7958
You don't need to use string concatenation for the model values. You are also missing a single quote at the end of the first style
value and a comma at then end of the attr
value:
<div data-bind="attr: { 'style': 'position:relative; float:left; width: width; height: height; '}, style: {border: $parent.foo() ? '1px solid black' : '1px solid white' }">
Upvotes: 3