ParamMap
interface
Matrix and Query parameters.
interface ParamMap {
keys: string[]
has(name: string): boolean
get(name: string): string | null
getAll(name: string): string[]
} Description
ParamMap makes it easier to work with parameters as they could have either a single value or multiple value. Because this should be known by the user, calling get or getAll returns the correct type (either string or string[]).
The API is inspired by the URLSearchParams interface. see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
Properties
| Property | Description |
|---|---|
keys: string[] |
Read-only. Name of the parameters |
Methods
| has() | ||
|---|---|---|
|
| name | Type: |
Returns
boolean
| get() | ||
|---|---|---|
| Return a single value for the given parameter name:
| ||
|
| name | Type: |
Returns
string | null
| getAll() | ||
|---|---|---|
| Return an array of values for the given parameter name. | ||
|
| name | Type: |
Returns
string[]
If there is no such parameter, an empty array is returned.
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/router/ParamMap