2016-10-26 1 views
1

에 대한 각도 2.0 definded되는 방법 :자식 노선들은 타이프 라이터에서 자식 경로과 같이 정의 할 수있다 다트

export const routes: Routes = [ 
    { path: '', redirectTo: 'product-list', pathMatch: 'full' }, 
    { path: 'product-list', component: ProductList }, 
    { path: 'product-details/:id', component: ProductDetails, 
    children: [ 
     { path: '', component: Overview }, 
     { path: 'specs', component: Specs } 
    ] 
    } 
]; 

다트에서 @RouteConfig 메타은 비슷하지만 자식들을 재산에이 아니다 자식 경로를 정의하는 경로.

Dart에서 하위 경로를 정의하는 적절한 방법은 무엇입니까? 다트에 대한 각도 2.0이 릴리스되었지만 다트에서 경로를 사용할 때 문서는 여전히 부족합니다.

답변

5

예, 설명서가 부족합니다. 사과드립니다. 우리는이 문제를 해결하기 위해 새로운 하위 팀을 구성하고 있습니다. 확실히 훨씬 나아질 것입니다. 당분간은 조금만 도와 드릴 수 있습니다 - 귀하의 ProductDetails 구성 요소는 단순히 자신의 것으로 선언해야합니다. :

@Component(...) 
@RouteConfig(const [ 
    const Route(path: '', component: Overview), 
    .... 
]) 
class ProductDetails {}