angular css 双向绑定的坑 IE

三种情况

1、只用style IE上不起作用

    <div style="background:{{bgColor}}">
        This will NOT get colored in IE
    </div>

2、用ng-attr-style 兼顾IE

    <div ng-attr-style="background:{{bgColor}}">
        But this WILL get colored in IE
    </div>

3、用ng-style 此处可以是JSon,可以带条件

    <div ng-style="styleObject">
        And so is this... as this uses a json object and   gives that to ng-style
    </div>
    或者
    ng-class="{'arrow-up-active': arrowNavTriangle === 'up' }"

猜你喜欢

转载自blog.csdn.net/sinat_29729453/article/details/60963294