0% found this document useful (0 votes)
22 views4 pages

Angular Router: Parameters: Jogesh K. Muppala

Angular Router allows paths to carry parameter values. Route parameters are specified in the path definition as tokens and can be passed as a link parameter array in router links or navigations. The ActivatedRoute service provides information about the route including the URL, required and optional parameters, and query parameters.

Uploaded by

vikram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

Angular Router: Parameters: Jogesh K. Muppala

Angular Router allows paths to carry parameter values. Route parameters are specified in the path definition as tokens and can be passed as a link parameter array in router links or navigations. The ActivatedRoute service provides information about the route including the URL, required and optional parameters, and query parameters.

Uploaded by

vikram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Angular

Router: Parameters

Jogesh K. Muppala
Angular Router
• Paths specified as a URL
• Paths can also carry parameter values:
– e.g., /dishdetail/42 where 42 is a route parameter
• Route parameters specified in the path definition
as a token
– e.g., path: ‘dishdetail/:id’ where id is the token

2
Route Parameters
• Route parameters can be specified using a link parameter
array while specifiyng the link
– e.g.,
<a *ngFor="let dish of dishes" [routerLink]="['/dishdetail', dish.id]">
• Can also be used within a method
– e.g., this.router.navigate(['/dishdetail', dish.id]);

3
ActivatedRoute Service
• Router service that provides useful information about
the routes, including:
– url: An Observable of the route path(s), represented as an
array of strings for each part of the route path.
– params: An Observable that contains the required
and optional parameters specific to the route
– queryParams: An Observable that contains the query
parameters available to all routes.

You might also like