DEV Community

Discussion on: Global error page in Angular

kostyatretyak profile image
Костя Третяк

That kind of makes the components lose their purpose.

No, it's not. On the contrary, we can use the components to the fullest, because we can use the appropriate component for the error handler:

<ng-container *ngIf="!httpErrorResponse">
  Current component code here

<cst-http-errors [httpErrorResponse]="httpErrorResponse"></cst-http-errors>
Enter fullscreen mode Exit fullscreen mode