gpt4 book ai didi

angularjs - 样式属性中的 Angular 错误 IE10 变量

转载 作者:行者123 更新时间:2023-12-04 17:22:27 24 4
gpt4 key购买 nike

如果我做这样的事情:

<div style="margin-left: 50px;">TEST1</div>
<div style="margin-left: {{50}}px;">TEST2</div>

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

不会应用值 test2 的左边距,这仅在 IE 中,有什么建议可以解决这个问题吗?

enter image description here

最佳答案

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

<div ng-style="{ 'margin-left': 50 + 'px'}">TEST2 {{50}}</div>

fiddle : http://jsfiddle.net/YXe8Z/

关于angularjs - 样式属性中的 Angular 错误 IE10 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19014765/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com