I'm using angular.js to repeat some data. One of bindings calculates x and y coords and set these with the ng-style-binding. This works fine in every browser except IE8. In IE8 it doesn't even seem to run my function.
But if I output it using {{ }} bindings as text it output correctly, but when using an attribute is does not.
My html look like this:
<span ng-repeat="obj in item.products" class="product-point" ng-style="getPos(obj.point.x, obj.point.y, index)">
<img ng-src="Images/add-button.png" width="100%" ng-click="addItemToList(obj.id)"/>
</span>
And the getPos function look like this:
$scope.getPos=function(x, y) {
x = (parseFloat(x) * 0.01) * imageSize.width;
y = (parseFloat(y) * 0.01) * imageSize.height;
return "left:"+Math.round(x)+"px; " +"top:"+Math.round(y)+"px";
}
Any ideas?
Seems to work if you return an object { top: y, left: x }
instead of a string.