简体   繁体   English

Angular:“严格使用”IE11

[英]Angular: “use strict” IE11

I ran into a problem in the browser IE11.我在浏览器 IE11 中遇到了问题。 The project is in Angular 2/4.该项目在 Angular 2/4 中。

Error: Multiple definitions of a property not allowed in strict mode. In file main.bundle.js

I had the same issue, It is because I tried to use some code like a case on ng-class attribute.我有同样的问题,这是因为我试图使用一些代码,比如ng-class属性的case

To solved I just change this为了解决我只是改变了这个

<div class="imgComment" ng-class="[{'.jpg':'imgJpg',
                     '.csv':'imgCsv',
                     '.xls':'imgXls',
                     '.xlsx':'imgXlsx',
                     '.doc':'imgDoc',
                     '.docx':'imgDocx',
                     '.msg':'imgMsg',
                     '.png':'imgPng',
                     '.pdf':'imgPdf',
                     '.jpg':'imgJpg',
                     '.jpeg':'imgJpeg',
                     '.zip':'imgZip',
                     '.rar':'imgRar',
                     '.txt':'imgTxt'}['{{f.fileExtension}}']]"
                     title="{{f.originalFileName}}" ng-click="showImage(f.sharePointPath)">
                    </div>

for this为此

<div class="imgComment {{f.style}}" title="{{f.originalFileName}}" ng-click="showImage(f.sharePointPath)"></div>

and send the class in f.Style attribute并在 f.Style 属性中发送类

I don't know if the problem was because I put 2 '.jpg' options in the case of the ng-class , I just change the code and works.我不知道问题是否是因为我在ng-class的情况下放置了 2 个 '.jpg' 选项,我只是更改代码并起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM