Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Is there a way to do NodeJs Express style Parameters in Angular?

I am wondering if there is a way to have a Parameter in Angular route that is similar to NodeJs Style ?

i have a route which looks like this "**http://myhost.domain.com/signin**" and i want to be able to pass an id for the signin request. I know i can do it like this "http://myhost.domain.com/signin?id=123456", but i am looking to do it more like a nodejs style where it would look like this http://myhost.domain.com/signin/123456

currently i read the params like this, but when i use the above url it cant find it since it thinks its one level deeper route.

    ngOnInit() {
            this.route.queryParams
                .subscribe(params => {
            console.log(params); 
    
          }
        );
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yes, you can do it. First, you need to configure the route in the Router:

const routes: Routes = [
  { path: 'signin/:id', component: SignInComponent }
]

Then, you can access it in the component like this:

import { ActivatedRoute } from '@angular/router';

...

constructor(private route: ActivatedRoute) {}

...

ngOnInit() {
  const id = this.route.snapshot.params.id;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!