{@a router-tutorial}
# Router tutorial: tour of heroes
# 路由器教程:英雄之旅
This tutorial provides an extensive overview of the Angular router.
In this tutorial, you will build upon a basic router configuration to explore features such as child routes, route parameters, lazy load NgModules, guard routes, and preloading data to improve the user experience.
本教程提供了关于 Angular 路由器的概要性概述。在本教程中,你将基于基本的路由器配置来探索诸如子路由、路由参数、惰性加载 NgModule、路由守卫和预加载数据等功能,以改善用户体验。
For a working example of the final version of the app, see the
| Member 成员 | Description 说明 |
|---|---|
has(name)
|
Returns `true` if the parameter name is in the map of parameters. 如果参数名位于参数列表中,就返回 `true`。 |
get(name)
|
Returns the parameter name value (a `string`) if present, or `null` if the parameter name is not in the map. Returns the _first_ element if the parameter value is actually an array of values. 如果这个 map 中有参数名对应的参数值(字符串),就返回它,否则返回 `null`。如果参数值实际上是一个数组,就返回它的*第一个*元素。 |
getAll(name)
|
Returns a `string array` of the parameter name value if found, or an empty `array` if the parameter name value is not in the map. Use `getAll` when a single parameter could have multiple values. 如果这个 map 中有参数名对应的值,就返回一个字符串数组,否则返回空数组。当一个参数名可能对应多个值的时候,请使用 `getAll`。 |
keys
|
Returns a `string array` of all parameter names in the map. 返回这个 map 中的所有参数名组成的字符串数组。 |