Questions tagged [angular-activatedroute]
118 questions
0
votes
1 answer
How do I use data from the table element from which I came?
I currently have a table of tasks, and I would like to be able to click on one of the tasks to bring me to a new page that shows me the history of all times that task has run. I need a way to pass the Name and ID of the task that I just clicked on…

Paul Soetaert
- 1
- 2
0
votes
1 answer
How to use RouterLinkActive in angular 8?
I have a page where there are three buttons, admin, student and logout. The logout button must appear only after the path changes to /admin or /student and make the admin and student buttons to disappear. How to use routerActiveLink in this…

R_B
- 11
- 4
0
votes
1 answer
Cannot receive queryparameters sent in Angular routing
I have a component that routes to another component passing some conditional parameters
This the code that defines the routing:
redirect(topicname : string){
alert(topicname)
this.router.navigate(['/chapters'], { queryParams: { topic:…

suman
- 57
- 8
0
votes
1 answer
Angular Activatedroute Params Always empty
I'm trying to build a mailing functionality in my app using angular, the problem is that I want to get parameters from the url to filter the mails. (example : inbox / sent / spam / trash ... etc)
Here are my Routes :
export const AppRoutes: Routes=…

Mohammed Chanaa
- 93
- 2
- 10
0
votes
0 answers
child.snapshot.issue angular I can t get the data from the activated route
hello there I have 2 routing module app.routing and account.routing I am trying to get the title from the route but is not working for the route under account.routing
{ path: 'mypath', loadChildren: () => import('./sap/sap.module').then(mod =>…

hiolk ygj
- 1
- 1
0
votes
1 answer
How do I mock id = this.route.snapshot.params.id; in angular?
I Want to mock this piece of code:
(This is a attribute in my component class)
id = this.route.snapshot.params.id;
I need it for my ActivatedRoute in my test, the error that I get is
cannot read property of 'route' undefined.
the mocking that I…

dinkelberg
- 9
- 6
0
votes
3 answers
Angular get query param and call service
I've got a problem in my angular app. I have to call a service reading some params from url. It's not working because the service is fired before the subscription to have the params is finished. In my service file I have this:
constructor(private…

Atlas91
- 5,754
- 17
- 69
- 141
0
votes
1 answer
this.activatedRoute.parent is null in angular service
I am unable to access parent object form activatedRoute in angular service, but it working fine in component. Is here any way to getting the same parent object in service.
import {ActivatedRoute} from '@angular/router'
constructor(private…

Saurabh Kumar
- 41
- 8
0
votes
2 answers
How to get Activatedroute in angular
I want to get the route when the URL changes
https://localhost:3200
to
https://localhotst:3200/login
how can i get login when there is change in route
I tried ActivateRoute but the code i made is not working
Here is what I've tried…

Mohit Kumar
- 552
- 9
- 29
0
votes
1 answer
Routing in matdialog in Angular
I am trying to add routing to a Angular Material Mat Dialog in angular. But there is an problem occurring.
When I try to add the route URL manually from
https://localhost:3200
to
https://localhost:3200/login
or
https://localhost:3200/signin
it…

Mohit Kumar
- 552
- 9
- 29
0
votes
0 answers
ActivatedRoute.snapshot.url doesn't have the first part of url in angular with multiple modules. How can I access to full URL?
I have three modules in angular (AppModule, ProductsModule and OrdersModule) with below configuration.
const appRoutes: Routes = [
{ path: '', component: HomeComponent, pathMatch: 'full' },
{ path: 'products', loadChildren: () =>…

AliHosseini
- 1
- 1
0
votes
1 answer
Issue resolving data with ActivatedRouteSnapshot and Observables
I have an issue with observables in Angular 2.
I can retrieve data from a DB using a service and can console.log the data in my service and resolver files, but I am unable to pass the data into my component.
I am using a service to query a…

gangstaShanks
- 11
- 4
0
votes
1 answer
Passing parameters between a parent page to the child component
I am having difficulty with the routing mechanism within Angular 9. I have a Buildings component and a BuildingDetailComponent. I cannot pick up the param inside the BuildingDetailCompoent. It's not in there even though it appears in the URL in the…

Whistler1
- 47
- 7
0
votes
1 answer
Angular subscribing to two levels of activated route
Below is my query, which only produces the artistID from the params using:
this._subscription = this._activatedRoute.params.pipe(
If however, I use:
this._subscription = this._activatedRoute.parent.parent.params.pipe( , I then get the albumID but…

Haven
- 87
- 1
- 9
0
votes
1 answer
Angular RouterLink Parameters - Activated Route not working
I am trying to get routerLink Parameter using ActivatedRoute.
constructor(private route: ActivatedRoute) { }
ngOnInit() {
this.pageTitle = this.route.snapshot.params['title'];
}
It shows the parameter first time only. But not again when the…

Saad Bashir
- 4,341
- 8
- 30
- 60