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

137
Views
Routing in angular without hash change but pushing it in the browser history stack

I have an Angular application consisting of the following routes:

const routes: Routes = [
  { path: '', component: IntroComponent },
  { path: 'personal-data', component: PersonalDataComponent },
  { path: 'questionnaire/:id', component: QuestionnaireComponent},
  { path: 'result', component: ResultComponent},
  { path: 'result/:id', component: ResultComponent}
]

The user starts in the IntroComponent, then goes to the PersonalDataComponent and then to 8 pages of QuestionnaireComponent which updates by id (for example /questionnaire/3), before ending up in the ResultComponent. This all happens by user clicks on buttons.

I would like when the route updates, the user does not see that in the url, so the url stays https://example.com but when the user presses the 'back' button in the browser, it does go back to the previous route.

I tried solving it using:

this.router.navigateByUrl(url, { skipLocationChange: true});

But that does not stack it in the browser history. Any ideas?

about 4 years ago · Juan Pablo Isaza
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!