风格属性中的Angular Bug IE10变量

Jer*_*sia 5 angularjs

如果我做这样的事情:

<div style="margin-left: 50px;">TEST1</div>
<div style="margin-left: {{50}}px;">TEST2</div>
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/XeVHL/1/

值test2的左边距将不会被应用,这仅在IE中,是否有任何建议可以解决这个问题?

在此输入图像描述

Jas*_*aat 9

作为一种解决方法,您可以使用ng-style:

<div ng-style="{ 'margin-left': 50 + 'px'}">TEST2 {{50}}</div>
Run Code Online (Sandbox Code Playgroud)

小提琴:http://jsfiddle.net/YXe8Z/