Add error dialog box.
- Add service for handling creation of error dialog. - Refactor directory layout.
This commit is contained in:
13
src/app/shared/error-dialog/error-dialog.component.html
Normal file
13
src/app/shared/error-dialog/error-dialog.component.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<div>
|
||||
<div>
|
||||
<p>
|
||||
Message: {{ data.message }}
|
||||
</p>
|
||||
<p>
|
||||
Reason: {{ data.reason }}
|
||||
</p>
|
||||
<p>
|
||||
Status: {{ data.status }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
25
src/app/shared/error-dialog/error-dialog.component.spec.ts
Normal file
25
src/app/shared/error-dialog/error-dialog.component.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ErrorDialogComponent } from './error-dialog.component';
|
||||
|
||||
describe('ErrorDialogComponent', () => {
|
||||
let component: ErrorDialogComponent;
|
||||
let fixture: ComponentFixture<ErrorDialogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ErrorDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ErrorDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
14
src/app/shared/error-dialog/error-dialog.component.ts
Normal file
14
src/app/shared/error-dialog/error-dialog.component.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import {Component, ChangeDetectionStrategy, Inject} from '@angular/core';
|
||||
import {MAT_DIALOG_DATA} from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-error-dialog',
|
||||
templateUrl: './error-dialog.component.html',
|
||||
styleUrls: ['./error-dialog.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ErrorDialogComponent {
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: string) { }
|
||||
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import { MenuToggleDirective } from '@app/shared/_directives/menu-toggle.directi
|
||||
import {RouterModule} from '@angular/router';
|
||||
import {MatIconModule} from '@angular/material/icon';
|
||||
import {TokenRatioPipe} from '@app/shared/_pipes/token-ratio.pipe';
|
||||
import { ErrorDialogComponent } from './error-dialog/error-dialog.component';
|
||||
import {MatDialogModule} from '@angular/material/dialog';
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +20,8 @@ import {TokenRatioPipe} from '@app/shared/_pipes/token-ratio.pipe';
|
||||
SidebarComponent,
|
||||
MenuSelectionDirective,
|
||||
MenuToggleDirective,
|
||||
TokenRatioPipe
|
||||
TokenRatioPipe,
|
||||
ErrorDialogComponent
|
||||
],
|
||||
exports: [
|
||||
TopbarComponent,
|
||||
@@ -27,10 +30,11 @@ import {TokenRatioPipe} from '@app/shared/_pipes/token-ratio.pipe';
|
||||
MenuSelectionDirective,
|
||||
TokenRatioPipe
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
MatIconModule
|
||||
]
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
MatIconModule,
|
||||
MatDialogModule,
|
||||
]
|
||||
})
|
||||
export class SharedModule { }
|
||||
|
||||
Reference in New Issue
Block a user