In order to be able to use the route and query parameters of an associated route, there is now the option of using paramMap.
The traditional approach
|
|
The new approach
|
|
Are there any advantages?
Yes, because using paramMap ensures that it is type-safe. Because in the previous version there was an insecure type (type params = {[key: string]: any}), which meant that the values could have all possible types. Instead, the new approach returns either a string or an array of strings. Depending on which method is used (*paramMap.get(): string or paramMap.getAll (): string []) *)
This text was automatically translated with our golang markdown translator.