Angular Router

From Angular core team member and creator of the router

Angular Router

Victor Savkin

From Angular core team member and creator of the router
Mapt Subscription
FREE
$29.99/m after trial
eBook
$19.60
RRP $27.99
Save 29%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$19.60
$34.99
$29.99p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781787288904
Paperback118 pages

Book Description

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, you might want to split applications into multiple bundles and load them on demand. Doing this transparently isn’t easy. 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. You’ll learn in detail how to use the router in your own applications. Predominantly, you’ll understand the inner workings of the router and how you can configure it to work with any edge cases you come across in your sites.

Throughout the book, you’ll see examples from real-world use in the MailApp application. You can view the full source of this application and see how the router code works to manage the state of the application and define what is visible on screen. 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.

Table of Contents

Chapter 1: What Do Routers Do?
Router configuration
Router state
Navigation
Summary
Isn't it all about the URL?
Chapter 2: Overview
URL format
Applying redirects
Recognizing states
Running guards
Resolving data
Activating components
Navigation
Summary
Chapter 3: URLs
Simple URL
Params
Query params
Secondary segments
Chapter 4: URL Matching
Backtracking
Depth-first
Wildcards
Empty-path routes
Matching strategies
Componentless routes
Composing componentless and empty-path routes
Summary
Chapter 5: Redirects
Local and absolute redirects
One redirect at a time
Using redirects to normalize URLs
Using redirects to enable refactoring
Chapter 6: Router State
What is RouterStateSnapshot?
Accessing snapshots
ActivatedRoute
Query params and fragment
Chapter 7: Links and Navigation
Imperative navigation
Summary
Chapter 8: Lazy Loading
Example
Lazy loading
Deep linking
Sync link generation
Navigation is URL-based
Customizing module loader
Preloading modules
Chapter 9: Guards
CanLoad
CanActivate
CanActivateChild
CanDeactivate
Chapter 10: Events
Enable tracing
Listening to events
Grouping by navigation ID
Showing spinner
Chapter 11: Testing Router
Isolated tests
Shallow testing
Integration testing
Summary
Chapter 12: Configuration
Importing RouterModule
Configuring router service
Disable initial navigation
Custom error handler

What You Will Learn

  • Understand the role of the Angular router and how to make the most of it
  • Build and parse complex URLs
  • Learn about the componentless and empty-path routes
  • Take control of states in your application
  • Make use of imperative navigation
  • Understand guards and how they can benefit your applications
  • Optimize configuration and run tests on your routing

Authors

Table of Contents

Chapter 1: What Do Routers Do?
Router configuration
Router state
Navigation
Summary
Isn't it all about the URL?
Chapter 2: Overview
URL format
Applying redirects
Recognizing states
Running guards
Resolving data
Activating components
Navigation
Summary
Chapter 3: URLs
Simple URL
Params
Query params
Secondary segments
Chapter 4: URL Matching
Backtracking
Depth-first
Wildcards
Empty-path routes
Matching strategies
Componentless routes
Composing componentless and empty-path routes
Summary
Chapter 5: Redirects
Local and absolute redirects
One redirect at a time
Using redirects to normalize URLs
Using redirects to enable refactoring
Chapter 6: Router State
What is RouterStateSnapshot?
Accessing snapshots
ActivatedRoute
Query params and fragment
Chapter 7: Links and Navigation
Imperative navigation
Summary
Chapter 8: Lazy Loading
Example
Lazy loading
Deep linking
Sync link generation
Navigation is URL-based
Customizing module loader
Preloading modules
Chapter 9: Guards
CanLoad
CanActivate
CanActivateChild
CanDeactivate
Chapter 10: Events
Enable tracing
Listening to events
Grouping by navigation ID
Showing spinner
Chapter 11: Testing Router
Isolated tests
Shallow testing
Integration testing
Summary
Chapter 12: Configuration
Importing RouterModule
Configuring router service
Disable initial navigation
Custom error handler

Book Details

ISBN 139781787288904
Paperback118 pages
Read More

Read More Reviews

Recommended for You

Learning AngularJS Testing [Video] Book Cover
Learning AngularJS Testing [Video]
$ 74.99
$ 63.75
AngularJS Directives Cookbook Book Cover
AngularJS Directives Cookbook
$ 31.99
$ 22.40
Learning JavaScript Promises: Practical Applications in ES6 and AngularJS [Video] Book Cover
Learning JavaScript Promises: Practical Applications in ES6 and AngularJS [Video]
$ 74.99
$ 63.75
Mastering AngularJS UI Development [Video] Book Cover
Mastering AngularJS UI Development [Video]
$ 94.99
$ 80.75
Introducing AngularJS [Video] Book Cover
Introducing AngularJS [Video]
$ 74.99
$ 63.75
Learning AngularJS Directives[Video] Book Cover
Learning AngularJS Directives[Video]
$ 49.99
$ 42.50