我安装了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)
[请帮助我,我尝试过多次以解决它,但问题仍然相同。
const routes: Routes = [{path:'student', component:StudentComponent},];