【问题标题】:change angular application loading url更改角度应用程序加载网址
【发布时间】:2022-01-08 22:58:24
【问题描述】:

在我的 Angular 应用程序中,当我运行应用程序时,它从 localhost:4200 开始,但我的要求是应用程序应该在 'localhost/test4health' 加载。谁能告诉我需要在哪里进行此更改?

【问题讨论】:

标签: javascript angular webpack


【解决方案1】:

您可以使用 Angular 路由来做到这一点

在您的 app-routing.ts 文件中,您可以将默认路由替换为:

const routes: Routes = [
  {
    path: '',
    pathMatch: 'full',
    redirectTo: '/test4health'
  }
];
  

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-11
    • 2013-01-26
    • 1970-01-01
    • 1970-01-01
    • 2016-06-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多