POV
POV

Reputation: 12005

Route Angular can can’t be reached

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

Answers (2)

aditya agnihotri
aditya agnihotri

Reputation: 36

Hi the correct way to use it like this.

{ path: 'register', component: AppComponent }

Upvotes: 1

Sudarshana Dayananda
Sudarshana Dayananda

Reputation: 5265

Remove / from Route path.

{ path: 'register', component: AppComponent }

Upvotes: 4

Related Questions