Leanpub Header

Skip to main content

Angular Router

The Complete Authoritative Reference

This book is a comprehensive guide to the Angular router written by its designer, who is a co-founder Nrwl - Angular Consulting for enterprise customers, from core contributors.

The book explores the library in depth, including the mental model, design constraints, subtleties of the API.

Reading the book will make you an Angular router expert.

Minimum price

$20.00

$25.00

You pay

$25.00

Author earns

$20.00
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
100
Pages
About

About

About the Book

Managing state transitions is one of the hardest parts of building applications. This is especially true on the web, where you also need to ensure that the state is reflected in the URL. In addition, we often want to split applications into multiple bundles and load them on demand. Doing this transparently isn’t trivial.

The Angular router solves these problems. Using the router, you can declaratively specify application states, manage state transitions while taking care of the URL, and load bundles on demand.

This book is a complete description of the Angular router written by its designer. It goes far beyond a how-to-get-started guide and talks about the library in depth. The mental model, design constraints, and the subtleties of the API-everything is covered. Reading this book will give you deep insights into why the router works the way it does and will make you an Angular router expert.

Share this book

Categories

Author

About the Author

Victor Savkin

Victor Savkin is an Angular core contributor, and co-founder of nrwl.io, providing Angular consulting to enterprise teams. Victor was previously on the Angular core team at Google, and built the dependency injection, change detection, forms, and router modules. Victor lives in Toronto, Ontario, enjoys playing around with eclectic programming tech, and has a particular interest in fonts and keyboard layouts.

Leanpub Podcast

Episode 41

An Interview with Victor Savkin

Contents

Table of Contents

Introduction

Example

Chapter 1: What Do Routers Do?

Chapter 2: Overview

  1. Applying Redirects
  2. Recognizing States
  3. Running Guards
  4. Resolving Data
  5. Activating Components
  6. Navigation
  7. Summary

Chapter 3: URLs

  1. Simple URL
  2. Params
  3. Query Params
  4. Secondary Segments

Chapter 4: URL Matching

  1. Backtracking
  2. Depth-First
  3. Wildcards
  4. Empty-Path Routes
  5. Matching Strategies
  6. Componentless Routes
  7. Composing Componentless and Empty-path Routes
  8. Summary

Chapter 5: Redirects

  1. Local and Absolute Redirects
  2. One Redirect at a Time
  3. Using Redirects to Normalize URLs
  4. Using Redirects to Enable Refactoring

Chapter 6: Router State

  1. What is RouterStateSnapshot?
  2. Accessing Snapshots
  3. ActivatedRoute
  4. Query Params and Fragment

Chapter 7: Links and Navigation

  1. Imperative Navigation
  2. Summary

Chapter 8: Lazy Loading

  1. Example
  2. Lazy Loading
  3. Deep Linking
  4. Sync Link Generation
  5. Navigation is URL-Based
  6. Customizing Module Loader
  7. Preloading Modules

Chapter 9: Guards

  1. CanLoad
  2. CanActivate
  3. CanActivateChild
  4. CanDeactivate

Chapter 10: Events

  1. Event Types
  2. Enable Tracing
  3. Listening to Events
  4. Grouping by Navigation ID
  5. Showing Spinner

Chapter 11: Testing Router

  1. Isolated Tests
  2. Shallow Testing
  3. Integration Testing
  4. Summary

Chapter 12: Configuration

  1. Importing RouterModule
  2. Configuring Router Service
  3. Disable Initial Navigation
  4. Custom Error Handler

Fin

  1. Bug Reports

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub