离子5(Angular9)-错误:未捕获(承诺中):错误:无法匹配任何路由。URL段:';简介';

离子5(Angular9)-错误:未捕获(承诺中):错误:无法匹配任何路由。URL段:';简介';,angular,ionic-framework,Angular,Ionic Framework,我在尝试点击主页->切换菜单并导航到“配置文件”时遇到此错误。我尝试了多种方法,但仍然是相同的错误。请帮助我 App-routig.module.ts 从'@angular/core'导入{NgModule}; 从“@angular/router”导入{preload所有模块,RouterModule,Routes}; 常数路由:路由=[ { 路径:“家”, loadChildren:()=>import('./home/home.module')。然后(m=>m.HomePageModul

我在尝试点击主页->切换菜单并导航到“配置文件”时遇到此错误。我尝试了多种方法,但仍然是相同的错误。请帮助我

App-routig.module.ts

从'@angular/core'导入{NgModule};
从“@angular/router”导入{preload所有模块,RouterModule,Routes};
常数路由:路由=[
{
路径:“家”,
loadChildren:()=>import('./home/home.module')。然后(m=>m.HomePageModule)
},
{
路径:“profile/”,
loadChildren:()=>import('./profile/profile.module')。然后(m=>m.ProfilePageModule)
},
];
@NGD模块({
进口:[
forRoot(路由,{preload策略:preload所有模块})
],
导出:[路由模块]
})

导出类AppRoutingModule{}
您的路由路径错误。也许只是打字错误。删除配置文件路径的额外正斜杠
/

{
    path: 'profile',
    loadChildren: () => import('./profile/profile.module').then( m => m.ProfilePageModule)
},

假设您在
AppModule
中导入
AppRoutingModule
,您能否将代码提供给
AppModule
?您好,路径:'profile',//而不是'profile/'=>这已经注释掉了您在代码中提供的路径是
'profile/'
,但它应该是
'profile'
。我已经更新了答案谢谢先生,我很抱歉忽略了这样一个低级的错误,很高兴它有所帮助。如果你的代码有效,请进行投票并接受答案。我已经接受了asnwer,谢谢!