我正在启动一个模态,并想设置一个路径。我目前在/home
,点击一个按钮,启动模态并调用此函数。
async launchCalculator() {
const calculator = await this.modalController.create({
component: CalculatorPage,
componentProps: {
dosingType: this.dosingType
},
showBackdrop: true,
});
return await calculator.present();
}
弹出模式对话框,但我想将URL更改为/calculator
我的app-routing.module.ts已经定义了路由,但是我可能没有正确调用模态或某些东西
const routes: Routes = [
{ path: '', redirectTo: 'Home', pathMatch: 'full' },
{ path: 'Home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'Calculator', loadChildren: './calculator/calculator.module#CalculatorPageModule' },
{ path: 'Results', loadChildren: './results/results.module#ResultsPageModule' },
];