Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用AngularJs ui路由器从URL中删除index.html和感叹号(!)?_Angularjs_Angular Ui Router - Fatal编程技术网

如何使用AngularJs ui路由器从URL中删除index.html和感叹号(!)?

如何使用AngularJs ui路由器从URL中删除index.html和感叹号(!)?,angularjs,angular-ui-router,Angularjs,Angular Ui Router,我的状态配置js 现在,我的URL看起来像这样 我想删除index.html和!从我的网址。如下图所示 如何做到这一点?有关$location方法html5Mode和hashPrefix,请参阅文档: 您应该避免发布代码和代码的图像,因为人们将无法测试代码并重现您的错误。 $location.hashPrefix('');

我的状态配置js

现在,我的URL看起来像这样

我想删除index.html和!从我的网址。如下图所示
如何做到这一点?

有关$location方法html5Mode和hashPrefix,请参阅文档:


您应该避免发布代码和代码的图像,因为人们将无法测试代码并重现您的错误。
$location.hashPrefix('');