Angular 6 Basics 29 - Route redirects and wildcards

preview_player
Показать описание

Learn how to redirect from one route to another using the `redirectTo` property of the `Route` object. Also use wildcard path mappings to handle cases of invalid routes.

Angular 6 Basics - Learn how to create Angular applications from scratch. Understand the Angular framework and learn how to use the features of the framework to create components and services. Use modules to organize your code. Build applications that call REST APIs and fetch data from a server. Implement routing to show multiple views with multiple URLs.

This course requires no previous knowledge of Angular or AngularJS.
Рекомендации по теме
Комментарии
Автор

The wildcard used (**) for routing an invalid page if specified at the beginning of the array gets matched for every route. This means we have to provide the wildcard entry only at the last of the array. Is there a better way to map invalid routes?

ashishkotnala
Автор

I like the way you explain, Hats of to your efforts. I am following you on each video, however, I found difficulties in reading as the font is too small in this video.

rohanrrkk
Автор

why my routes redirect didnt work for empty url const routes: Routes =
[
{path: '', redirectTo: '/home'},
{path: 'home', component:HomeComponent},
{path: 'settings', component:SettingsComponent}
]; it will work without empty path, thanks

reneeli
Автор

How do I create an equivalent of a master page in angular? For example, when the user goes to the About us page, I would like to still show the navbar and the footer.

petekuranchie