Reusable component & pipe for http error rendering
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<div class="http-error">
|
||||
<p><b><ng-content></ng-content></b></p>
|
||||
<i class="small">({{ error | httpErrorMsg }})</i>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
.http-error {
|
||||
width: 100%;
|
||||
margin: 1em auto;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-http-error',
|
||||
templateUrl: './http-error.component.html',
|
||||
styleUrls: ['./http-error.component.scss']
|
||||
})
|
||||
export class HttpErrorComponent {
|
||||
@Input() error: HttpErrorResponse | null;
|
||||
}
|
||||
Reference in New Issue
Block a user