Questions tagged [angular-activatedroute]
118 questions
0
votes
0 answers
On refresh angular params are empty and it's not taking the current query param values
I have queryparams with some values. If i did any changes in the form the changedvalue is coming in the urlbar.refreshquery param is getting empty.changed value is not coming.
I tried with activatedroute.queryparams.subscribe in ngoninit(). First…

K_H
- 1
- 1
0
votes
0 answers
How to test mentioned code in jasmine test cases
Component :
Global variable declaration
sub:any = []
ngonit()
{
this.sub =
this.router.params.subscribe(par
ams =>
{
this.taskId = params['taskId']
}
Spec.file:
what I tried sofar...
I tried creating below params object
activateStub = {
params:…

Adithya
- 183
- 1
- 2
- 16
0
votes
0 answers
ActivatedRoute not working anymore after path change
I changed the route from:
{
path: 'detail-component/:Name',
component: DetailComponent,
}
to :
{
path: 'detail-component',
component: DetailComponent,
children: [{ path: ':Name', component: DetailComponent }],
}
I know that both…

Antonio Florian
- 3
- 3
0
votes
0 answers
Connect pageSize and pageSelection - activatedRoute
0
I have a little problem with the Pagination - Cities quest.
I have navbar-with-selection with page and with pageSize.
When I select pageSize: 5, the pages resize correctly (so on the last page in this case, page 16, only 2 cities remain).
PageSize…

Aneta Walicka
- 1
- 1
0
votes
0 answers
Angular how run a pipeable operator before all the subscriptions to the queryParams observable in the entire app?
I want to run a pipeable operator before all the subscriptions in my Angular app!
I'm trying to reach that because I'm encrypting the queryParams in the URL so I want to run this pipeable operator to decrypt the queryParams that way I'm making sure…

CoderNadir
- 11
- 3
0
votes
1 answer
Subscribing to URL fragment not firing event on change in Angular
I am using Angular 13 and I am trying to subscribe to the ActivatedRoute 'fragment'. The subscription is only receiving a notification when the page first loads, but is not receiving updates when the fragment gets updated.
Here is an example of what…

Anker Peet
- 41
- 8
0
votes
1 answer
Check if router link is active in Angular using Typescript
How can I check if the current route matches my routerLink string?
class TestComponent implements OnInit {
@Input()
public routerCmd: string;
constructor(private router: Router) {}
ngOnInit(): void {
// Pseudo code
…

btx
- 1,972
- 3
- 24
- 36
0
votes
0 answers
queryParamMap of activatedRoute is not fetching the value from url. Its showing as null
I have 2 applications from one to another I'm redirecting using window.location.href and passing the query parameter from 1st application. (Shown below in screenshot)
In the 2nd application, I'm trying to access the query parameter using the…

Ashwini B
- 23
- 8
0
votes
1 answer
How can I get a parent route params from a child component using activatedRoute?
I am working with a child component and I am having trouble getting access (I think) to it's parent route params.
My url looks like…

Damon
- 4,151
- 13
- 52
- 108
0
votes
1 answer
Dynamically change query params Angular unit test
I have a component that has 2 different states dependent on the query params provided.
Here's the 2 query param states:
const mockLocalQueryParams = {
Id: Guid.create(),
customerId: Guid.create(),
};
const mockOrganicQueryParams = {
…

Ashley Slaney
- 17
- 4
0
votes
1 answer
Angular Activated Route does not fetch the object associated with the route
I am trying to create routes for user profiles in Angular. The snapshot, no-observable approach, almost behaves like I want; where the getUser() function outputs the user object in my template. It falls short in that I can't update the user once I…

Eric Kumar
- 21
- 3
0
votes
3 answers
Passing parameters to route not found - Angular 12
Defining the Route in my app-routing :
{ path: 'user/:id', component: UserDetailComponent },
Defining the Navigation
detail
In UserDetailComponent
this.id = +this.route.snapshot.params['id'];
Firstly. I get…

Ayoub Haddi
- 11
- 2
0
votes
1 answer
Angular Activated Route - Fetch parent of url
I am using Angular 13 and need help with the Activated route. In short, I have 2 x routes:
/form/:id/:settings
/report/:id/:query
Whilst I know how to fetch the params such as :id, I am having trouble working out how to determine which route the…

Ka Tech
- 8,937
- 14
- 53
- 78
0
votes
1 answer
Passing activated route params form parent component to children
In app-routing I have one parent component and 3 childrens:
{
path: 'media', component: MediaComponent,
children: [
{ path: '', redirectTo: 'photos', pathMatch: 'full' },
{ path: 'photos', component: PhotosComponent },
{…

Andrei Kruza
- 1
- 2
0
votes
1 answer
Angular route data empty after refresh or enter direct url in browser
I am facing issue with Angular routing while accessing the data property in the ActivatedRouteSnapshot instance.
The route data is available if I go by clicking the link button but if type url directly in the browser or refresh the page then route…

Developerzzz
- 1,123
- 1
- 11
- 26