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

747
Vistas
Angular 12: navigate and reload page

I have angular application in which I need to reload page after navigation. I have applied this solution but window.location.reload(); does not work on production. So I have added useHash: true in app-routing.module.ts file. But that also giving me problems while applying SSR in application. So I need alternate way for below code:

this.router.navigate(['path/to'])
  .then(() => {
    window.location.reload();
  });

I have tried by applying window.location.href = window.location.href , window.location.href = window.location.protocol + '//' + window.location.host + '/path/to'; instead of window.location.reload(); but it does not reload the page as expected.

Is there any other way to achieve reloading after navigating in angular 12? Please help and guide.

Edit : Why reload: In application, after login of user, notifications are shown in header. That does not show data if page not reloaded.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could try to redirect to root and then redirect to your final destination:

this.router.navigate(['/'])
  .then(() => {
    this.router.navigate(['path/to'])
  });
about 4 years ago · Juan Pablo Isaza 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