0
子单元想用孩子模块
const routes: Routes = [
{ path: '', component: ProcComponent,
children:[{
path: '/LoadProcResultsdata/:procResults', component: ProcResultsComponent,
}]
}
];
App.Module.ts从一个页面导航到另一个页面
const routes: Routes = [
{ path: 'app', component: AppComponent },
{ path: 'home', component: HomeComponent },
{ path: 'treeview', component: TreeViewComponent },
{path:'Proc', loadChildren:'app/proc/Proc.Module#ProcModule'}
]。
我的代码
this.router.navigate(['/LoadProcResultsdata/'],{ queryParams: { procResults:this.results } });
但我得到下面的错误。
core.umd.js:3064 EXCEPTION:未捕获(承诺):错误:无法匹配任何路由。 URL段:'LoadProcResultsdata' 错误:无法匹配任何路由。 URL段:“LoadProcResultsdata”
谢谢四位回应。 this.results是一组字符串,我想通过不同的页面。有没有更好的方法将字符串或数组传送到不同的页面。 – Venu
@Venu,当然你可以使用queryparams传递数组,我已经更新了我的答案,并且还添加了示例Plunker,Cheers! –
我尝试了没有参数,但仍然给出了相同的错误。, – Venu