I make this routing config
@RouteConfig([
{
path:'/profile/:id',name:'Profile',component:ProfileComponent
},
// else
{
path: '/**',
redirectTo: ['Home']
}
])
and used this to navigate Profile with parameter {id:5}
<a [routerLink]="['Profile', {id:5}]" >Go </a>
i added to index.html head this base
<base href="/">
It successfully navigated to
http://localhost:3000/profile/1
and worked fine
but when i paste same URL manual in browser and hit enter it give me this error
Error happen because files are not loaded from root directory
http://localhost:3000
but browser trying to load them form relative URL directory
http://localhost:3000/profile/1
UPDATE: I am using angular 7 now, this kind of problem is fixed without need to add any thing