September 2017
Intermediate to advanced
450 pages
11h 24m
English
By setting the path to an empty string, we will define it as the index route for our router. We can then provide it any component we want to present to the user, but what if we wanted to use a route you have already defined in your application as your home page? For example, in our blog application, we will want to serve the posts component as the home page of our application. This configuration is possible through the use of the redirectTo property in the route configuration:
RouterModule.forRoot([ { path: "", component: PostsComponent }, { path: "posts", redirectTo: "" } ...])
With the preceding configuration, the PostsComponent will be served for all visitors on the home page of our application, and anyone who navigates ...
Read now
Unlock full access