<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m" -->

---
title: Controlling Navigation Flow | daily.dev
description: A comprehensive walkthrough of Angular's routing guards (CanActivate, CanActivateChild, CanDeactivate, CanMatch, and the deprecated CanLoad) and data...
canonical: https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Controlling Navigation Flow | daily.dev
og:description: A comprehensive walkthrough of Angular's routing guards (CanActivate, CanActivateChild, CanDeactivate, CanMatch, and the deprecated CanLoad) and data...
og:url: https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m
og:image: https://api.daily.dev/og/posts/bgAzpQF7m.png
og:image:alt: Controlling Navigation Flow
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Controlling Navigation Flow

**[Angular.love](https://daily.dev/sources/angularlove)** · 16 min read · 0 upvotes · 0 comments

## Summary

A comprehensive walkthrough of Angular's routing guards (CanActivate, CanActivateChild, CanDeactivate, CanMatch, and the deprecated CanLoad) and data resolvers, explaining how each guard type controls navigation access, their return types, and code examples for common use cases like authentication and feature flags. It then covers resolvers for pre-fetching route data, configuring them in route definitions, consuming resolved data via ActivatedRoute signals or withComponentInputBinding, and three approaches to error handling (withNavigationErrorHandler, subscribing to router events, and catching errors directly in resolvers). Additional topics include handling loading state during navigation and accessing parent resolver data in child resolvers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://angular.love/guards-and-resolvers-controlling-navigation-flow>

## Questions this post answers

### What is the difference between CanActivate and CanMatch guards in Angular?

CanActivate blocks or redirects navigation to a route, canceling navigation entirely if it returns false, while CanMatch, when it returns false, does not cancel navigation but instead lets Angular continue searching for other matching route definitions. This makes CanMatch useful for feature flags, A/B testing, and conditionally assigning different components to the same path.

_daily.dev surfaces practical Angular routing guides like this for developers choosing between guard types._

### How do I handle errors thrown by an Angular resolver without breaking navigation?

Three approaches work: centralize handling with withNavigationErrorHandler so resolvers stay focused on fetching data, subscribe to router events and filter for NavigationError to build custom recovery logic, or catch errors directly inside the resolver using RxJS catchError and return a RedirectCommand to redirect the user, for example back to a list page after a failed fetch.

_Developers debugging resolver failures can find this kind of Angular error-handling detail on daily.dev._

### Can Angular child route resolvers access data fetched by a parent route resolver?

Yes, resolvers execute in parent-to-child order, so once a parent route's resolver successfully fetches data, that data becomes available to child resolvers through route.parent.data. A child resolver can read the parent's resolved value, such as a user object, to fetch related data like that user's posts.

_daily.dev helps Angular developers piece together nested routing and resolver patterns like this one._

## Similar posts on daily.dev

- [Routing for beginners](https://daily.dev/posts/routing-for-beginners-qghjsoei4) · Angular.love · 1 upvotes · 0 comments
- [How To Use Query Parameters with Angular Router](https://daily.dev/posts/how-to-use-query-parameters-with-angular-router-uniqwnjiy) · DigitalOcean Community · 1 upvotes · 1 comments
- [Angular NgRx: An Overview](https://daily.dev/posts/angular-ngrx-an-overview-wc5ufngir) · Atomic Spin · 0 upvotes · 0 comments
- [Understanding React Routing: Building Single Page Applications the Right Way](https://daily.dev/posts/understanding-react-routing-building-single-page-applications-the-right-way-qdfahnbn4) · Medium · 2 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#angular](https://daily.dev/tags/angular)

[View this post on daily.dev](https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Controlling Navigation Flow","url":"https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m"},"datePublished":"2026-09-20T07:44:36.013Z","dateModified":"2026-09-20T07:50:49.423Z","description":"A comprehensive walkthrough of Angular's routing guards (CanActivate, CanActivateChild, CanDeactivate, CanMatch, and the deprecated CanLoad) and data...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9bb41197ddeebccde547125c502f7e21?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9bb41197ddeebccde547125c502f7e21?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Angular.love","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Angular.love","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/b638946cd9c74bf6a260e4e6a40212d7","url":"https://daily.dev/sources/angularlove"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"typescript,angular","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Angular.love","item":"https://daily.dev/sources/angularlove"},{"@type":"ListItem","position":3,"name":"Controlling Navigation Flow"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/controlling-navigation-flow-bgazpqf7m#faq","mainEntity":[{"@type":"Question","name":"What is the difference between CanActivate and CanMatch guards in Angular?","acceptedAnswer":{"@type":"Answer","text":"CanActivate blocks or redirects navigation to a route, canceling navigation entirely if it returns false, while CanMatch, when it returns false, does not cancel navigation but instead lets Angular continue searching for other matching route definitions. This makes CanMatch useful for feature flags, A/B testing, and conditionally assigning different components to the same path. daily.dev surfaces practical Angular routing guides like this for developers choosing between guard types."}},{"@type":"Question","name":"How do I handle errors thrown by an Angular resolver without breaking navigation?","acceptedAnswer":{"@type":"Answer","text":"Three approaches work: centralize handling with withNavigationErrorHandler so resolvers stay focused on fetching data, subscribe to router events and filter for NavigationError to build custom recovery logic, or catch errors directly inside the resolver using RxJS catchError and return a RedirectCommand to redirect the user, for example back to a list page after a failed fetch. Developers debugging resolver failures can find this kind of Angular error-handling detail on daily.dev."}},{"@type":"Question","name":"Can Angular child route resolvers access data fetched by a parent route resolver?","acceptedAnswer":{"@type":"Answer","text":"Yes, resolvers execute in parent-to-child order, so once a parent route's resolver successfully fetches data, that data becomes available to child resolvers through route.parent.data. A child resolver can read the parent's resolved value, such as a user object, to fetch related data like that user's posts. daily.dev helps Angular developers piece together nested routing and resolver patterns like this one."}}]}
```

