函数调用的ngStyle在IE中不起作用

时间:2017-10-27 14:42:24

标签: javascript css angular ng-style

在角度4应用程序中我有如下样式

[ngStyle]="{'border': getInterleaveColor(i)}"

和功能

 getInterleaveColor(auditNumber) {
    var borderProperties = '2px solid';
    if (auditNumber % 2 == 0)
        return borderProperties + '#0078D2';
    else
        return borderProperties + '#00B989';
}

在Chrome中正常工作但在IE中无效。

1 个答案:

答案 0 :(得分:0)

您需要在实体后添加空格,以便solidhex color不是单个字符串

var borderProperties = '2px solid ';