Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

304
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda