Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

ParamMap

A map that provides access to the required and optional parameters specific to a route. The map supports retrieving a single value with get() or multiple values with getAll().

      
      interface ParamMap {
  keys: string[]
has(name: string): boolean
get(name: string): string | null
getAll(name: string): string[] }

See also

Properties

Property Description
keys: string[] Read-Only

Names of the parameters in the map.

Methods

Reports whether the map contains a given parameter.

      
      has(name: string): boolean
    
Parameters
name string

The parameter name.

Returns

boolean: True if the map contains the given parameter, false otherwise.

Retrieves a single value for a parameter.

      
      get(name: string): string | null
    
Parameters
name string

The parameter name.

Returns

string | null: The parameter's single value, or the first value if the parameter has multiple values, or null when there is no such parameter.

Retrieves multiple values for a parameter.

      
      getAll(name: string): string[]
    
Parameters
name string

The parameter name.

Returns

string[]: An array containing one or more values, or an empty array if there is no such parameter.