Man*_*ush 6 production-environment angular ng-build
我的角度应用程序托管在服务器中,其中应用程序URL为http://xyz.domain.in(示例网址)。现在,我在其中创建了子目录来托管另一个应用程序。但是,当我尝试访问类似http://xyz.domain.in/subfolder的路径时,请在控制台中获取它。
错误:无法匹配任何路线。网址段:“子文件夹”
子文件夹中的应用程序的基本href是
<base href="./subfolder">
Run Code Online (Sandbox Code Playgroud)
如何做到这一点?
Art*_*ory 15
启动构建时,必须指定子文件夹的路径:
ng build --base-href=/subfolder/
Run Code Online (Sandbox Code Playgroud)
您需要pathMatch像这样添加到您的路线中:
{path: 'url', component: YourComponent, pathMatch: 'subfolder'},
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2918 次 |
| 最近记录: |