填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫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