我在一个模块中有多个组件。我想根据路由路径显示组件。对于http://localhost:4200/account我想显示帐户组件。对于http://localhost:4200/setting我想显示设置组件 ..etc
app.routing.module.ts
{
path: 'account',
loadChildren: './modules/settings/settings.module#SettingsModule',
},
{
path: 'settings',
loadChildren:'./modules/settings/settings.module#SettingsModule',
},
Run Code Online (Sandbox Code Playgroud)
settings.routing.module.ts
export const routes: Routes = [
{
path: 'account',
component: accountComponent
},
{
path: 'account/edit',
component: accountEditComponent
},
{
path: 'settings',
component: settingsComponent
},
{
path: 'settings/edit',
component: settingsEditComponent
}
];
Run Code Online (Sandbox Code Playgroud)
我在 settings.routing.module.ts 中做了哪些更改以显示这些组件。