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

384
Views
How can I set a default route in Angular?

I'm having problems developing a route as default... if you put sitename.com ... it assumes the default Login route, getting sitename.com/login, so far so good....

My problem is that if I go to the page through a sitename.com/home shortcut... I don't see any page, as if I couldn't find the path... I wanted to put this shortcut on the default page. .. Login.

To do this do I have to configure the routes or do I have to do something else?

Can anyone help me?

app.module.ts

import { RouterModule, Routes } from '@angular/router';

 imports: [
    RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }),
 ],

const routes: Routes = [
  { path: '', redirectTo: 'login', pathMatch: 'full' },
 { path: 'home', component: HomeComponent },

];
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try

RouterModule.forRoot(routes, {useHash: true})

and Login page will be accessed by direct URL as sitename.com/#/login

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!