如何使用AngularJS从IE9中的URL中删除index.html [英] How can I remove index.html from URL in IE9 with AngularJS
问题描述
大家好,
我有一个AngularJS实现,其中我主要有html和JS文件,并从AngularControllers调用我的WebApi。
我有一个实现,我将重定向到index.html页面。
在此代码之后,index.html是
我遇到了一个问题,我将重定向到index.html页面的问题被添加到我的URL中。每次都有这个不必要的加载index.html页面。
当我在JS代码下面实施时,它适用于Chrome和IE 10及以上版本,但在IE9中停止。
Hi All,
I have a AngularJS implementation where I have mostly html and JS files and calling my WebApi from AngularControllers.
I have one implementation, where I am redirecting to index.html page.
After this code, index.html is
I stuck in a problem where I am redirecting to index.html page is getting added to my URL. This unnecessary loading index.html page every time.
When I implmented below JS code, It is working fine for Chrome and IE 10 and Above, but stopping in IE9.
app.config(function ($locationProvider) {
$locationProvider.html5Mode(true);
}
在IE9中,它不断尝试加载页面并无休止地进行。(我的意思是它不断添加index.html并尝试一次又一次地重定向。)
如果有人有任何想法请给我指示。
谢谢
Rushi
In IE9, it keep trying to load pages and going endlessly. (I mean it keep adding index.html and trying to redirect again and again.)
Please if someone has any idea then provide me direction.
Thanks
Rushi
推荐答案
locationProvider){
locationProvider) {
locationProvider.html5Mode(true);
}
locationProvider.html5Mode(true); }
在IE9中,它不断尝试加载页面并无休止地进行。 (我的意思是它继续添加index.html并尝试一次又一次地重定向。)
如果有人有任何想法请给我指示。
谢谢
Rushi
In IE9, it keep trying to load pages and going endlessly. (I mean it keep adding index.html and trying to redirect again and again.)
Please if someone has any idea then provide me direction.
Thanks
Rushi
您必须在您的应用程序中设置路线,请遵循以下代码: -
You have to Set the Route In Your Application please follow this code :-
angular.module('phonecat', []).
config(['
这篇关于如何使用AngularJS从IE9中的URL中删除index.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!