填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

Angular 路由

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.

要处理从一个视图到下一个视图的导航,请使用 Angular RouterRouter会通过将浏览器 URL 解释为更改视图的操作指令来启用导航。

To handle the navigation from one view to the next, you use the Angular Router. The Routerenables 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:

了解 Angular 路由

Learn about Angular routing