[在Angular8中,我在路由中遇到了一些问题

问题描述 投票:1回答:2

我安装了Angular 8,还安装了通用的SEO,完成所有部分,并且成功运行了Angular 8应用程序。然后创建一个新组件,该组件的名称为student,然后转到app-routing.modules.ts文件并包含:

const routes: Routes = [{path:'/student', component:StudentComponent},];

然后我运行我的应用程序并导航到URL http://localhost:4000/student,并发生以下错误:

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'student' Error: Cannot match any routes. URL Segment: 'student'at router_ApplyRedirects.noMatchError (D:\Angular\mydemo\dist\server\main.js:117488:16)

[请帮助我,我尝试过多次以解决它,但问题仍然相同。

angular angular-ui-router angular-routing
2个回答
0
投票

0
投票
const routes: Routes = [{path:'student', component:StudentComponent},];
© www.soinside.com 2019 - 2024. All rights reserved.