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

305
Vistas
How to route to error page without leaving the current page in Angular

I have running Angular 9 application and as per the correct implementation, if any unhandled exception occurs, I am routing to error page.

@Injectable()
export class CustomErrorHandler implements ErrorHandler {
   handleError(errorObj) {
      router.navigate(['/error'], { queryParams: { error: JSON.stringify(errorDetails) } })
   }
}

I am using ErrorHandler class and want to display error page as overlay , where in error page will be displayed on top of the current page and in background the current page should still be shown.

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

0

I recommend you to use the dialog from Angular Material

Imports:

import { MatDialog } from '@angular/material'; 

Constructor:

constructor(
  private dialog: MatDialog,
) { }

Function to display the dialog:

error() {
 const dialogRef = this.dialog.open(CustomErrorHandler, {
   width: '70%', // Make this as big as you want
   data: { error: this.errorType } //Put here the data you want to display one the error page. If you dont need it just delete the line and the ,
 });
}

You can find more info here

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