如何避免在任何IE版本上加载Angular?

如何避免在任何IE版本上加载Angular?,angular,Angular,每个角度index.html页面都以这种形式结束 if(document.documentMode){//ie window.location.href=“/index basic.html” } 我只是不知道如何做到这一点,因为这对我来说是新的。我需要配置一些东西来防止index basic.html充当路由吗?我似乎无法逃离路由器 有没有直接的解决办法 您可以通过以下示例实现: 这可能会有帮助: let isIEOrEdge = /msie\s|trident\/|edge\//i.t

每个角度
index.html
页面都以这种形式结束


if(document.documentMode){//ie
window.location.href=“/index basic.html”
}
我只是不知道如何做到这一点,因为这对我来说是新的。我需要配置一些东西来防止
index basic.html
充当路由吗?我似乎无法逃离路由器


有没有直接的解决办法

您可以通过以下示例实现:

这可能会有帮助:

let isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent)

如果你根本不想加载角度,你可以采用这种方法。只要确保重定向到一个没有角度依赖项的现有页面

换句话说,你应该有你的默认
index.html
(有角度的那一个)和另一个页面来使用你描述的方法重定向

在你的网站上
index.html

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>My Awesome App</title>
    <base href="/">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/x-icon" href="favicon.png">
</head>
<script type="text/javascript" src="assets/js/browser-check.js"></script>
<body>
<app-root>
</app-root>
</body>
</html>
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Not supported Browser</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.png">
</head>
<body>

<section>
  <h1>Unsupported browser</h1>
  <p>The navigator you are using is not supported. Consider upgrade your browser.</p>
</section>
</body>
</html>
我希望它有帮助:)