我有一个可滑动的模式,上面有一个按钮。当用户点击时,我需要取消模式并导航到另一个组件。我已经完成了路线和所有的事情,但我犯了一个错误:
错误:未知(承诺):错误:不能匹配任何路由。URL段:“子细节”
如果我从父组件导航,而不经过模式,它就能工作。
我认为这种模式是在创造自己的路线。有办法绕过吗?我觉得我需要“离开”模式来导航。
谢谢
modal.component.ts
async goTo(where: string) {
await this.modalCtrl.dismiss();
this.router.navigate('sub-detail');
}模块
imports: [
CommonModule,
RouterModule.forChild([
{ path: '', pathMatch: 'full', component: SubscriptionComponent },
{ path: 'sub-detail', component: SubscriptionDetailsComponent },
{ path: 'options', component: SubscriptionModalComponent },
]),
IonicModule,
UniversalModules
],发布于 2020-03-27 05:49:33
你不能从模态导航到任何地方,所以让模态完成并返回到页面,然后进行导航。
https://stackoverflow.com/questions/60842374
复制相似问题