当他点击数据表行时,我会将用户重定向到另一个页面
在 HTML
中<p-table [value]="users" selectionMode="single" [(selection)]="selectedUser" dataKey="uid" (onRowSelect)="selectedUserDetails($event)" styleClass="tab-result">
TS文件中的
selectedUserDetails(userDetails) {
console.log(userDetails);
console.log("enterhere"); // is printed on console dev
this.router.navigate['/userdetails'];
}
在模块路由
中const routes: Routes = [
{
path: "",
component: AdministrationComponent,
children: [
{ path: "", component: ResulTabComponent, pathMatch: "full" },
{ path: "userdetails", component: UserDisplayComponent }
]
}
];
对于信息管理路线,在此路径上http://localhost:4200/administration
userdetails应为http://localhost:4200/administration/userdetails
在管理组件
中<router-outlet></router-outlet>
我的问题是点击时我没有被重定向到userdetails
页面,但当我从url栏导航到/ userdails时,我看到了组件
答案 0 :(得分:8)
您尚未调用该函数,只是尝试访问 df1 %>%
filter(!week %in% week_e)
week sales
1 1 10
2 2 24
3 3 23
4 4 54
5 5 65
6 6 45
属性中名为/userdetails
的属性。你错过了navigate
()
答案 1 :(得分:0)
添加括号&#34;()&#34;并删除斜杠&#34; /&#34;
function range(arr1, arr2){
var arr = [];
for( var i = arr1; i <= arr2; i++ ){
arr.push(i);
}
return arr;
}
尝试如下路由:
exchanges