Questions tagged [angular-router-params]

30 questions
8
votes
1 answer

Unable to read querystring parameters from App.Component

I would like to centralize where/how I read a specific querystring parameter throughout my application, so I figured the best place to do this was in the app.component.ts export class AppComponent implements OnInit, OnDestroy { constructor( …
7
votes
4 answers

Angular Router.navigate to child route with queryParams

Can't navigate to child route with queryParams by Angular.Router.navigate Аlready tried: this.router.navigateByUrl('/desktop/search?q=folder')); this.router.navigate(['desktop', 'search'], { queryParams: {q: 'folder'}…
2
votes
2 answers

Route query parameters is empty on first render in Angular

I have a scenario in which I decide the actions based on the query parameters of the angular url. For example, if the url is localhost:4200/token=abc I need to do some tasks and if the url is localhost:4200 then I need to do something else. I have…
2
votes
1 answer

Angular route params in service

I need to get route param in my service import {Inject, Injectable} from '@angular/core'; import {BehaviorSubject} from 'rxjs'; import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; @Injectable({ providedIn: 'any' }) export class…
2
votes
0 answers

Angular Router Resolve function not working

// user-resolver.service.ts import { Injectable } from '@angular/core'; import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; import { User } from 'firebase/app'; import { Observable } from 'rxjs'; import {…
Nishant Jain
  • 197
  • 1
  • 9
1
vote
0 answers

Angular query params when refreshing Page

I have an issue, that is struggling me. Scenario - Page A and Page B: In Page A I have a button that navigate to Page B adding a query params this.router.navigate(['asignaturas', 2, 'datosgenerales'], {queryParams: {edit: false}}); Page B is…
Lopes
  • 363
  • 1
  • 3
  • 9
1
vote
1 answer

how to input two route parameters one of which is in between the URL for navigation while using children routes in Angular CLI 8+ using Angular Router

I am trying to navigate to a page providing two route parameters as follows: author/journals/:journal_Id/draftArticles/:articleId I know that two parameters can be given when route parameter is at the end of the route like…
1
vote
0 answers

Get set optional language parameter in angular 6 Home route

I'm trying to pass a language code in the url like localhost4200/en-us/ and get the language code inside the child component, but it's not working and when I try to navigate localhost4200/en-us/ like this then my app start to request resources from…
Sabir Hossain
  • 1,183
  • 1
  • 25
  • 46
1
vote
1 answer

How to subscribe to child route params and use result to run another service?

I'm trying to have the following scenario working; I have a screen, lets call it AdminComponent, which has two sidebars and a router-outlet which displays the selected item route.
1
vote
0 answers

ionic 4 router.navigate with navigationExtras does not overwrite queryParams in certain cases

I have an inventory app (device and browser) where a user can keep an inventory of hobby parts. I have a dashboard which shows part categories (Parts Bins). If you click on the category, you see the parts within the category, then if you click on…
1
vote
1 answer

Angular 5 Show browser alert when query param changes

I have a Parent component Item which has route '/Item'. I have two children component name Catalogue component and AddSize component. By default, Catalogue component will be loaded with route '/item?q=catalogue'. Then user select product then route…
1
vote
1 answer

Update routeparams in angular 5

i have a route like this dashboard/tour/2/269, this component represents tour details, and inside that component there are some links which refer to similar tours, so when a user click one of those links i want to reload the component based on the…
1
vote
3 answers

subscribe route params in a component outside of router outlets component

I have a toolbar component aligned above a router outlet. The router outlet has various components like table and chart. Am able to subscribe to route params in any of the components that are displayed using a router outlet. I want to access route…
0
votes
1 answer

Angular define route params from root

I want to make a route path from base url: my-domain.com/3 It was not working with path: ':id' and the page will be stuck: export const routes: Route[] = [ { path: '', component: LayoutComponent, canActivate: [IsAuthenticated], …
0
votes
1 answer

How to encrypt / decrypt query params in Angular automatically?

I want to encrypt query params URL in Angular. my URL now looks like this: https://example.com/posts/235645?asc=1&published=true what I want to approach is to see the previous URL…
1
2