当“loadChildren”加载模块时,angular2路由器不起作用

时间:2017-03-23 08:56:24

标签: angular angular2-routing

我有这样的路由器定义:

const routes: Routes = [
{
    "path": "member",
    "loadChildren": "app/member/member.module#MemberModule"
},
{
    "path": "",
    "loadChildren": "app/video/video.module#VideoModule"
},
{
    "path": "**",
    "redirectTo": ""
}
]

这样的MemberRouter定义:

const routes: Routes = [
{
    "path": "order",
    "component": MemberComponent,
    "loadChildren": "app/member/order/order.module#OrderModule"
},
{
    "path": "",
    "component": MemberComponent,
    "loadChildren": "app/member/index/index.module#IndexModule"
}
]

OrderRouter定义如下:

const routes: Routes = [
{
    "path": "list",
    "outlet": "member",
    "component": OrderComponent,
    "loadChildren": "app/member/order/list/list.module#ListModule"
},
{
    "path": "",
    "outlet": "member",
    "component": OrderComponent
}
]

ListRouter定义如下:

const routes: Routes = [
{
    "path": "",
    "outlet": "order",
    "component": ListComponent
}
]

它不适用于“/ member / order / list”

正在“/ member / order”

工作 当“MemberRouter”延迟加载

时,“OrderRouter”规则无法匹配 当嵌套

时,

“loadChildren”不起作用

请帮帮我解决,谢谢!

Plunker Demo点击“产品/明细/项目”按钮无效。

0 个答案:

没有答案