我有一个 angular 6 项目,结构如下...
src
|- app
| |- core
| | |- layout.component.ts/html/scss
| | |- core.module.ts
| |- views
| | |- modules
| | | |- sample
| | | | |- sample.component.ts/html/scss
| | | | |- sample-routing.module.ts
| | | | |- sample.module.ts
|- app.component.ts/html/scss
|- app-routing.module.ts
|- app.module.ts
Run Code Online (Sandbox Code Playgroud)
...示例模块的路由结构看起来像...
const routes: Routes = [
{
path: '',
children: [
{
path: '',
component: SampleComponent
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
}) …Run Code Online (Sandbox Code Playgroud)