I have a viewmodel like this,
var sectorViewModel = function() {
this.currentValue = ko.observable();
this.previousValue = ko.observable();
....
this.maxValue = ko.computed(function() {
return Math.max(this.currentValue(), this.previousValue(), ...);
}, this);
}
ko.applyBinding(sectorVM, document.getElementById("divSector");
And this is the html snippet where I am doing the data-bind,
<div id="divSector">
...
<div class="bar" data-bind="style: {width: (currentValue()*100)/maxValue() + '%'}"></div>
...
</div>
Works fine in all browsers except for IE8. In IE8 I see this error in dev tool -
Invalid argument. Unable to process binding "style: function() {return..."
Any idea how can I get this to work in IE8?
Thanks.