Reputation: 12005
My route rules are:
export const appRoutes: Routes = [
{ path: "", component: HomeComponent },
{ path: '/register', component: AppComponent },
{ path: "**", redirectTo: "/" }
];
I tried to open URL:
https://localhost:80/register
It redirects me to /
page.
Upvotes: 1
Views: 71
Reputation: 36
Hi the correct way to use it like this.
{ path: 'register', component: AppComponent }
Upvotes: 1
Reputation: 5265
Remove / from Route path.
{ path: 'register', component: AppComponent }
Upvotes: 4