Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.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
Angular 2路由删除大部分原始URL_Angular - Fatal编程技术网

Angular 2路由删除大部分原始URL

Angular 2路由删除大部分原始URL,angular,Angular,我的ASP.NET web应用程序的子文件夹中有一个小HTML页面。URL如下所示: https://company.com/application/folder/index.html 当我在任何浏览器中加载页面并且脚本包完成加载时,URL将更改为: http://company.com/#/home 如何保留原始URL?我本以为会看到: https://company.com/application/folder/index.html#home 您必须在index.html文件中设置hr

我的ASP.NET web应用程序的子文件夹中有一个小HTML页面。URL如下所示:

https://company.com/application/folder/index.html
当我在任何浏览器中加载页面并且脚本包完成加载时,URL将更改为:

http://company.com/#/home
如何保留原始URL?我本以为会看到:

https://company.com/application/folder/index.html#home

您必须在
index.html
文件中设置
href
属性

<base href="/application/folder/">

但是要知道,您的所有文件都必须与此路径相关

希望这有帮助