Loading topic
Routes array, router-outlet, routerLink, route parameters, and the basics of dependency injection and RxJS. Lat5 min readRoutes array, and basic RxJS. It covers how to write a guard as a plain function and how to get services into it with inject(). The chapters before and after this one cover the return values and each guard t4 min readinject() and you know how Observables and Promises differ. It covers what the router does with the value your guard produces. That value decides whether the navigation continues, stops, or goes somewhere else.4 min readRoutes array, and how Observables and Promises differ. It builds on the earlier chapters about functional guards and guard return values.4 min readRoutes array, route parameters, routerLink). It also assumes you have written a simple functional guard. Here you will learn how a guard redirects the user instead of on5 min readcanActivate guard with inject() and return a UrlTree to redirect. It also assumes you know how nested children routes work. The earlier chapters cover both.4 min readcanActivate guard, know how inject() works inside one, and have a component with a form. By the end you will be able to stop a user from leaving a page with unsaved edits, ask for confirmation, and cover the cases the router cannot see.4 min readinject() and know the Routes array, lazy loading with loadChildren and loadComponent, and the return types a guard may use (boolean, UrlTree, Observable, Promise). Here you will learn what makes canMatch different from `can5 min readRoutes array, have used canActivate and ResolveFn at a basic level, and know that guards can return a boolean, a UrlTree, an Observable, or a Promise. Here you learn the exact sequence the router follows, so you can predict which guard runs first, whe6 min readinject() inside a function. Guards decide whether a navigation may proceed. A resolver answers a different question: what data must exist before the route's componen5 min readResolveFn and attach it to a route with the resolve map. It also assumes you know basic RxJS and Angular signals. Here you will learn how the data a resolver returns reaches your component, and which mistakes cause it to arrive missing or stale.4 min readResolveFn and read resolved data in a component. It also assumes you are comfortable with RxJS operators such as catchError, retry, and of. Here you will see what the router does when a resolver fails, and how to turn that failure into a deliberate 4 min readResolveFn, and that you know basic RxJS operators and Angular signals. You will add a loading indicator that tracks every navigation. It will not flicker on fast navigations, and it will always turn off, whatever way the navigation ends.4 min readTestBed, Jasmine or Jest style describe/it, and basic RxJS. Functional guards are plain functions that call inject(). You test them by running them in an injection context with fake dependencies.4 min readcanActivate guard, redirect with a UrlTree, and use canMatch with lazy-loaded routes. It also assumes you know basic HTTP status codes and how an Angular app talks to an API. The chapter explains what a guard can and cannot protect, and where rea4 min read@Injectable, constructor injection, and the Routes array. Here you will learn to read the older class-based style, map each part to its functional equivalent, and migrate code step4 min read