Angular 2 Router how to hide browser url parameter

2019-05-23 15:55发布

How do I route to employeeDetail/23 but represent to the user an alias URL like /EmployeeDetails?


Background

I'm trying to implement Angular 2 routing and when I went to the detail section I see:

http://localhost:3444/employeedetail/23.

Here I want to hide that 23 on the browser URL.


Example

http://plnkr.co/edit/QgehylornOgXhTaZX8Yn?p=preview

{path: 'crisis-center/:id/:id2', component: CrisisDetailComponent}

I want to hide those IDs on the browser URL and instead present an alias route name.

0条回答
登录 后发表回答