如何在 angular 中使用不同路由使用同一模块
how to use same module using different routes in angular
我正在开发一个 angular 应用程序,其中我们有多个使用相同模块的菜单(A、B、C、D、E)。
菜单 A、C 和 E 使用相同的 component/module。
我的要求是当我在 A 上时,如果我在菜单上单击 C,则应该加载相同的组件,但数据不同。我正在使用来自“@ionic/angular”的 NavController 的 navigateRoot 函数在单击菜单项时进行导航。
您需要制作 2 条路线,两条路线都加载相同的组件。
例如:
const routes: Routes = [
{ path: 'edit/:id', component: EditCustomerComponent },
{ path: 'add', component: EditCustomerComponent },
];
我正在开发一个 angular 应用程序,其中我们有多个使用相同模块的菜单(A、B、C、D、E)。 菜单 A、C 和 E 使用相同的 component/module。 我的要求是当我在 A 上时,如果我在菜单上单击 C,则应该加载相同的组件,但数据不同。我正在使用来自“@ionic/angular”的 NavController 的 navigateRoot 函数在单击菜单项时进行导航。
您需要制作 2 条路线,两条路线都加载相同的组件。 例如:
const routes: Routes = [
{ path: 'edit/:id', component: EditCustomerComponent },
{ path: 'add', component: EditCustomerComponent },
];