angular css 双向绑定的坑 IE

来源:互联网 发布:仿淘宝网站源码 php 编辑:程序博客网 时间:2024/04/28 11:01

三种情况

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' }"
1 0
原创粉丝点击