angular - Angular 中未检测到子路由
问题描述
我正在开发一个离子应用程序(Ionic 5),似乎我无法让路由正常运行。这是我的应用程序路线。
但似乎我无法让这个网址工作 /state/test-centers
Angular没有找到那条路线..这是跟踪
我只是在尝试这个..我也试过这个..也没有用..
{
path: "state",
component: StateComponent,
pathMatch: "full",
children: [
{ path: "test-centers", component: TestCentersComponent, pathMatch: "full" }
]
}
解决方案
你不需要pathMatch
策略,你的路由应该是这样的
{
path: "state",
component: StateComponent,
children: [
path: "",
component: StateComponent,
children: [
{path: "test-centers" , component:TestCentersComponent}
]
]
}
推荐阅读
- php - Apache 升级到 Big Sur 后找不到 php
- python-3.x - if/else 语句与 Heaviside 函数
- algorithm - 二分搜索基础
- swift - 转换`UnsafeMutableBufferPointer
?>` 到`数据` - javascript - 单击取消后关闭弹出窗口
- mysql - 分页查询的高成本
- firebase-authentication - 尝试导入错误:“signInUserWithEmailAndPassword”未从“firebase/auth”导出
- java - java线程不一致
- php - Laravel 块返回少量数据 - Laravel
- python - 通过 os.system 调用奇异 exec 命令后执行 os.system python 命令