Problems using angular ng-style, not updating in IE

若如初见. 提交于 2019-12-01 17:36:46

ng-style accepts an Angular expression that evaluates to an object. This means that if you want to use a variable inside that expression, you can use it directly (without the double-curlies):

ng-style="{width: liWidth + 'px'}"

Double-curlies are used when you want to insert a dynamic, interpolated value to an argument that accepts a string, like <img alt="{{product.name}} logo">. You then put an expression inside those brackets.

Try to do :

ng-style="{'width':liWidth+'px'}">

No curly bracket, a lot of ng directive don't like it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!