Configurable Routing
Note: Spartacus 2.x is no longer maintained. Please upgrade to the latest version.
Introduction
Navigation in a web application is mostly done through URLs. Spartacus allows you to customize these URLs, which can be used to deep-link into a specific application state, and can contribute to the usability and SEO capabilities of the application.
In a single-page application, URLs are intercepted by the application logic so that the view(s) can be updated seamlessly. This requires routing logic, which, in the case of Spartacus, is provided by the Angular Router.
While the Angular Router contains a rich set of features and configuration options, Spartacus contains components that are intended to run without any configuration by default.
This is where configurable routes come in to play: every route in Spartacus is configurable.
For more information, see the following:
- Adding and Customizing Routes
- Route Configuration
- Configurable Router Links
- Disabling Standard Routes
- Additional Route Parameters
- Route Aliases
- External Routes
- Early Login
Limitations
- Translation of routes in many languages is not currently supported
- Configuration of lazy-loaded routes is not currently supported
- Routing based on hash (Angular’s
HashLocationStrategy
) is not supported - Secondary routes (and named router outlets) are not currently supported