rc5 java_RC5重定向子路由错误

我正在关注the Angular2 routes tutorial . 我'm trying to redirect the default router ' ' to ' enderecamento'我在控制台上收到此错误:

KWarj.png

我的路由代码如下:

app.routing.ts:

export const appRoutingProviders: any[] = [

];

const pecaJuridicaRoutes: Routes = [

{

path: '',

redirectTo: 'pecaJuridica',

pathMatch: 'full'

},

{

path: 'pecaJuridica',

component: PecaJuridicaComponent,

pathMatch: 'full',

children: [

{ path: 'enderecamento', component: EnderecamentoComponent,},

{ path: '', redirectTo: 'enderecamento', pathMatch: 'full' }

]

},

];

console.log(pecaJuridicaRoutes);

const appRoutes: Routes = [

...pecaJuridicaRoutes,

];

export const routing = RouterModule.forRoot(appRoutes);

奇怪的是,如果我改变:

[...]

children: [

{ path: 'enderecamento', component: EnderecamentoComponent,},

{ path: '', redirectTo: 'enderecamento', pathMatch: 'full' }

]

[...]

对此:

[...]

children: [

{ path: 'enderecamento', component: EnderecamentoComponent,},

{ path: '', component: EnderecamentoComponent, }

]

[...]

'enderecamento'页面已加载,但是如果iIclick在页面中的routerLink上重定向它或在上下文'pecaJuridica / enderecamento'上写入得到相同的Uncaught promise [object Object]错误,有没有办法调试它?这非常令人沮丧,因为我知道它必须是一件简单的事情,而这些错误信息对我来说并不直观 .

一些额外的信息:

Redirection plnkr:

Redirection routerLink plnkr:

routerLink html code:

[...]

[...]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值