liveBook · Manning

Direct navigation

As explained in Pro Angular 16

Direct navigation is entering or requesting an application URL directly rather than reaching it through in-application navigation.

Direct navigation requests an application URL directly instead of reaching it through in-application links. It exposes whether a route can initialize correctly without earlier navigation steps. section 24.3.2

Opening an edit route directly

Requesting http://localhost:4200/form/edit/2 can produce an empty edit form when the data source assumes a product was selected through the table. The route parameter identifies the product, but the required data has not necessarily arrived. section 24.3.2

Server-side rendering makes application routes available for direct requests, including routes whose interactive forms are unsuitable for SSR. A browser guard can redirect guarded server-side requests to the default route while allowing browser navigation. section 27.4.6

Account for these direct-navigation behaviors:

  • Route parameters can identify an operation and item, but the component must read them and load or select the corresponding data. section 24.3.2
  • Do not rely on changing the form method alone: the SSR process does not create handlers for HTTP POST requests. section 27.4.6

How Pro Angular 16 covers it

How deep it goes
Explains route failures and implements an Angular guard, while deferring dedicated server-side HTML application design.
Examples
Uses direct edit URLs, missing product data, BrowserGuard, route registration, and disabled SSR routes.
What it assumes
Assumes Angular routing, route parameters, and server-side rendering; demonstrates their interaction with browser requests and application data.
What you can do after
Configure Angular route guards to redirect unsuitable server-side requests and diagnose data-dependent failures from direct URLs.
How it connects
Connects URL routing, route parameters, data loading, route guards, and server-side rendering.

This explainer was generated by Manning's knowledge graph from the text of Pro Angular 16. The section links point to the parts of the book it draws on.