I am looking for equivalent of $urlRouterProvider.otherwise
in Angular 2.
More details:
I have a router definition like this:
@RouteConfig([
{ path: "/", component: MultiPost, name: "Home", useAsDefault: true },
{ path: "/m/:collectionName/:categoryName/:page", component: MultiPost, name: "MultiPost" }
])
Both routes are working perfectly, for instance when I hit /
or /m/sth/sth/0
I got what I want.
But when I hit a random url like /kdfsgdshdjf
nothing happens. Page is rendered and <router-outlet>
is empty since no route is matched.
What I want to do is to redirect all non matching routes to a default one. I need something like $urlRouterProvider.otherwise("/");
.
Does anyone knows how to do that?