Search code examples
angularangular2-routing

Angular2 fallback route


How can I configure Angular2 router to redirect me to a default route (or any other) if I go to a non existent route?


Solution

  • I found this solution

    { component: HomeComponent, path: "", pathMatch: "full" },
    { component: LoginComponent, path: "/login" },
    { component: NotFoundComponent, path: "**" }