IE11 Angular 2 error “Expected identifier, string or number”

后端 未结 2 1730
梦谈多话
梦谈多话 2020-12-15 04:46

Well, I have created site using Angular 2. When I run \"ng-serve\" command and trying to test my site using \"http://localhost:4200\" in Google Chrome and IE11 it works perf

相关标签:
2条回答
  • 2020-12-15 05:03

    The main problem is IE has Compatibility Mode enabled by default. And IE 11 has some compatibility mode issues. As per the followings question answer Angular 2 / 4 not working in IE11

    When I tried to disable the compatibility mode off It works fine.

    But ingeneral user will not off the compatibility mode. So I want a good solution for that.

    Then I found following solution form Force IE compatibility mode off using tags

          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    
    0 讨论(0)
  • 2020-12-15 05:08

    I googled it and found that it was maybe reserved words in my identifiers key:value pairs.

    No. These are not relevant to IE11.

    Fix

    You are most likely running raw .ts files. You should be hosting (in your script tags) the bundled / built .js files.

    0 讨论(0)
提交回复
热议问题