-1
동일한 하위 모듈을로드하는 두 가지 주요 경로가 있습니다. 기본 경로와 관련하여 두 개의 다른 구성 요소를로드하는 하위 모듈에 같은 이름의 두 경로를 가질 수있는 가능한 방법이 있습니까?각도 2 다른 모듈 동일한 라우팅
홈페이지 경로 :
export const ROUTES: Routes = [{
path: 'first',
loadChildren: './features/common#CommonModule',
canActivate: [AppAuthGuard]
}, {
path: 'second',
loadChildren: './features/common#CommonModule',
canActivate: [AppAuthGuard]
}]
지금은 그래서
export const routes = [{
path: 'list', component: FirstListComponent, pathMatch: 'full' }
},{
path: 'list', component: SecondListComponent, pathMatch: 'full' }
}]
같은 라우팅 뭔가를하기 위해 공통 모듈을 기대하고있어, 나는
- 만약 뭔가를 원하는 경로는 첫 번째/목록, n FirstListComponent이로드되어야합니다.
- 경로가 초/목록 인 경우 SecondListComponent이로드되어야합니다.
경로 순서가 중요하다는 것을 알고 있습니다. 그리고 제안 된 방법은 불가능합니다. 아무도 이것을 달성하기위한 가능한 모든 방법을 제안 할 수 있습니까?
덕분에 같은 경로를 설정하십시오. 그러나 이렇게 사용하면 총 경로는 * first/first/list * 및 * second/second/list *가됩니다. – Teja
@ Teja : https://angular.io/guide/router#child-routing-component의 라우팅 문서를 참조하십시오. 라우팅에 대한 더 좋은 아이디어를 얻을 수 있습니다. – baj9032