Angular Routing
In a single-page app, you change what the user sees by showing or hiding portions of the display that correspond to particular components, rather than going out to the server to get a new page. As users perform application tasks, they need to move between the different views that you have defined.
To handle the navigation from one view to the next, you use the Angular Router
. The Router
enables navigation by interpreting a browser URL as an instruction to change the view.
To explore a sample app featuring the router's primary features, see the .
Prerequisites
Before creating a route, you should be familiar with the following:
- Basics of components
- Basics of templates
- An Angular app—you can generate a basic Angular application using the Angular CLI.
Learn about Angular routing
Learn how to implement many of the common tasks associated with Angular routing.
Single-page applications (SPAs) routing tutorialA tutorial that covers patterns associated with Angular routing.
Tour of Heroes expanded routing tutorialAdd more routing features to the Tour of Heroes tutorial.
Creating custom route matches tutorialA tutorial that covers how to use custom matching strategy patterns with Angular routing.
Router referenceDescribes some core router API concepts.
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/guide/routing-overview