Chapter 4. Router advanced

This chapter covers

  • Guarding routes
  • Creating components that have multiple router outlets
  • Lazy-loading modules

This chapter covers some advanced router features. You’ll learn how to use router guards that allow you to restrict access to certain routes, warn the user about unsaved changes, and ensure that important data is retrieved before allowing the user to navigate to a route.

We’ll then show you how to create components that have more than one router outlet. Finally, you’ll see how to load modules lazily—meaning only when the user decides to navigate to certain routes.

This chapter doesn’t include the hands-on section for ngAuction. If you’re eager to switch from dealing with routing to learning other Angular ...

Get Angular Development with Typescript, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.