Angular Ionic 4 RouterLink无法在带有选项卡和侧菜单的应用程序上运行

Angular Ionic 4 RouterLink无法在带有选项卡和侧菜单的应用程序上运行,angular,ionic-framework,router,Angular,Ionic Framework,Router,我用tabs模板创建了一个ionic应用程序。 我想在一页上显示其他页的侧菜单 侧菜单出现,我可以单击这些项目,但路由器不会更改路由,旧页面将保留 我希望你能帮助我 app-routing.module.ts 从'@angular/core'导入{NgModule}; 从'@angular/router'导入{Routes,RouterModule}; 常数路由:路由=[ {path:'dashboard',loadChildren:'./pages/dashboard/dashboard.mo

我用tabs模板创建了一个ionic应用程序。 我想在一页上显示其他页的侧菜单

侧菜单出现,我可以单击这些项目,但路由器不会更改路由,旧页面将保留

我希望你能帮助我

app-routing.module.ts

从'@angular/core'导入{NgModule};
从'@angular/router'导入{Routes,RouterModule};
常数路由:路由=[
{path:'dashboard',loadChildren:'./pages/dashboard/dashboard.module#DashboardPageModule'},
{path:'contacts',loadChildren:'./page/contacts/contacts.module#ContactsPageModule'},
{path:'menu',loadChildren:'./pages/food menu/food menu.module#FoodMenuPageModule'},
{path:'calendar',loadChildren:'./pages/calendar/calendar.module#CalendarPageModule'},
{path:'settings',loadChildren:'./pages/settings/settings.module#SettingsPageModule'},
{路径:'**',重定向到:'仪表板'},
{path:'login',loadChildren:'./pages/login/login.module#LoginPageModule'},
{path:'administrator',loadChildren:'./pages/administrator/administrator.module#administratoragemodule'},
{path:'news feed',loadChildren:'./pages/news feed/news feed.module#NewsFeedPageModule'},
{路径:'imprint',loadChildren:'./pages/imprint/imprint.module#ImprintPageModule'},
{path:'about',loadChildren:'./pages/about/about.module#AboutPageModule'},
{path:'privacy',loadChildren:'./pages/privacy/sprivacy.module#PrivacyPageModule'}
];
@NGD模块({
导入:[RouterModule.forRoot(路由)],
导出:[路由模块]
})
导出类AppRoutingModule{}
dashboard.page.ts

从'@angular/core'导入{Component,OnInit};
从'@ionic/angular'导入{MenuController};
从'@angular/Router'导入{Router};
@组成部分({
选择器:“应用程序仪表板”,
templateUrl:“./dashboard.page.html”,
样式URL:['./dashboard.page.css'],
})
导出类DashboardPage实现OnInit{
sideMenuPages=[
{title:'Administration',url:'administrator',图标:undefined},
{title:'Settings',url:'settins',icon:undefined},
{标题:'Imprint',url:'Imprint',图标:未定义},
{标题:'隐私',url:'隐私',图标:未定义},
{title:'About',url:'About',icon:undefined},
]
构造函数(专用菜单:菜单控制器,专用路由器:路由器){}
恩戈尼尼特(){
this.menu.enable(true,'dashboardMenu');
}
toggleMenu():无效{
this.menu.toggle('dashboardMenu');
}
}
dashboard.page.html


巴格劳肖
菜单
{{page.title}}
app.component.html


应用程序
仪表板
联络
菜单
历法

感谢您的帮助。

请继续我的评论,我在评论中提到通过删除除一个链接以外的所有链接来缩小问题的范围

问题可能出在实际的
routerLink
路径上。当您单击链接时,URL中会显示什么,控制台中是否有任何错误


尝试通过添加正斜杠来更新路径,例如,
[routerLink]=“['/'+page.url]”

在尝试使用10之前,您应该尝试使用菜单中的一个路由。这使得调试更加困难。例如,在<代码>路由> <代码>的中间,您有一个<代码> *> <代码>通配符路由,这工作正常吗?也许可以注释掉这些路线中的大多数,看看它是否只适用于1,然后从there@Drenai我将“**”移到最后一行并取消对所有路径的注释,只有选项卡和管理员取消注释。但这不起作用……这就是问题所在,“/”丢失了。我需要“/”来从“根”开始路由,这是正确的吗?@KreLou就是这样-一个前导的
/
告诉路由器从应用程序的根开始。Angular API文档是解决这类问题的救命稻草——它是最新版本的。我一直在查阅文档——这里几乎没有什么宝贵的信息以及顶层概述