Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

631
Vistas
exclude specific path from routing in angular 2+

My angular route config is as below:

export const routes: Routes = [
  { path: 'mgmt', ... },
  { path: 'about', ... },
  { path: '**', component: PageNotFoundCmp }
];

But now on a page, there's a link (<a href="/help/en/index.html" target="_blank">) to help pages, which are static resources hosted on the same server. With the above route config, apparently it will be matched to others ** - page not found.

Let's say we cannot host help resources in another domain, is there any way to exclude /help/** path from angular routing? or do you think this is a valid feature request for angular to support?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

As mentioned here angular 2 exclude url in routing the only solution seems to set useHash: true in your RouterModule config:

@NgModule({
  imports: [
    RouterModule.forRoot(
      [
        {
          path: 'login',
          loadChildren: './login/login.module#LoginModule'
        },
        {
          path: '**',
          redirectTo: ''
        },
      ],
      {
        useHash: true,
        onSameUrlNavigation: 'reload'
      }
    )
  ],
  exports: [RouterModule]
})
export class AppRoutingModule { }
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda