具有“ ng样式”或“ ng-attr样式”的Dom内容不会在Internet Explorer和Safari中生成,但在chrome中可以正常工作

Sou*_*rav 5 javascript css internet-explorer dom angularjs

当我在Internet Explorer和Safari中检查网站元素时,以下代码完全消失了(没有生成)。但是在chrome和Firefox中完全可以使用。

使用ng-attr-style在这里不起作用(即使在Chrome中也是如此)。在chrome浏览器中,它(在检查时)生成代码,但在前端不起作用。在IE或Safari浏览器中,代码甚至没有生成(检查时)。

尝试了以下解决方案,但这些解决方案没有带来任何好的https://docs.angularjs.org/guide/ie

IE中的AngularJS错误,样式为ng样式

角度-Safari无法正确显示DOM

Angular ng-style在Safari中不会更新

Angular js ng样式不起作用

我的代码:

<div
    style="cursor: pointer;"
    title="{{ line.line.type == 'solid' ? 'Date: ' + vm.$filter('date')(vm.getDateFromSeconds(line.line.date)) : 'Current Date: ' +  vm.$filter('date')(vm.getDateFromSeconds(line.line.date)) }}&#13;{{ line.line.type == 'solid' ? 'Name: ' + line.line.name : undefined }}"
    class="eventLines {{'type-'+line.line.type}}"
    ng-repeat="line in col.eventLine track by $index"
    ng-style="{{line.styleCss}}">
    <div 
        class="lineSquare" 
        ng-show="outerIndex==1" 
        ng-style="{'background':line.line.color}">
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

在Chrome中生成的输出(实际需要):

<div 
    style="cursor: pointer; position: absolute; z-index: 1; height: 50px; width: 2px; left: 46.0161px; border-left: 2px dashed rgb(75, 78, 83);" 
    title="Current Date: Aug 5, 2019" 
    class="eventLines type-dashed" 
    ng-repeat="line in col.eventLine track by $index" 
    ng-style="{&quot;position&quot;:&quot;absolute&quot;,&quot;z-index&quot;:1,&quot;height&quot;:&quot;50px&quot;,&quot;width&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;46.59677419354839px&quot;,&quot;border-left&quot;:&quot;2px dashed #4B4E53&quot;}">
        <div 
            class="lineSquare ng-hide" 
            ng-show="outerIndex==1" 
            ng-style="{background:line.line.color}" 
            aria-hidden="true" 
            style="background: rgb(75, 78, 83);">
        </div>
</div>
Run Code Online (Sandbox Code Playgroud)