Angular4路由在IE中不起作用,而它在Mozilla和chrome中运行良好

时间:2017-11-15 11:39:51

标签: java angular tomcat frontend

您好我已经使用tomcat服务器创建了一个angular4应用程序,并且我的所有路由在chrome和Mozilla中运行良好,而相同的路由在IE11上不起作用。

我尝试过的事情

1.在IE浏览器的polyfills.ts中进行更改

  1. useHash:true
  2. 但这些改变对我没有用。

    基本上我想处理重新加载按钮功能,路由对于mozilla和chrome工作正常,但在IE11中不起作用。

1 个答案:

答案 0 :(得分:0)

我通过添加额外的路径来解决它,附加了我的战争名称。我有一条路径' index.html',映射到第一条路线,但对于IE,它需要路径:' myApp / index.html',其中myApp是我的tomcat战争名称。

表示chrome:

  

路径:' index.html',redirectTo:' / abc / admin'

IE的

  

路径:' myapp / index.html',redirectTo:' / abc / admin'