我们有一个带有以下 URL 的应用程序。
http://localhost:8080/myapp/#/route1
我的路由配置如下
export const routeConfig = [
{
path: 'myapp',
children: [
{
path: 'route1',
loadChildren: 'app/route1/route1.module#Route1Module',
}
]
}];
当我尝试访问 URL 时,出现以下错误 -
Error: Cannot match any routes. URL Segment: 'myapp/'
Error: Cannot match any routes. URL Segment: 'route1'
at t.noMatchError (main.bundle.js:1)
at e.selector (main.bundle.js:1)
at e.error (polyfills.bundle.js:1)
at e._error (polyfills.bundle.js:1)
at e.error (polyfills.bundle.js:1)
在这种情况下,路由的正确配置是什么?基本 href 应该是什么?