-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
<p>error works!</p> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12 mt-4"> | ||
<h1 jhiTranslate="error.title.string" class="mb-3.string">Your request cannot be processed</h1> | ||
|
||
<div [hidden]="!errorMessage"> | ||
<div class="alert alert-danger">{{ errorMessage }}</div> | ||
</div> | ||
<div [hidden]="!error403" class="alert alert-danger" jhiTranslate="error.http.403.string"> | ||
You are not authorized to access this page. | ||
</div> | ||
<div [hidden]="!error404" class="alert alert-danger" jhiTranslate="error.http.404.string"> | ||
The page does not exist. | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { AccountService } from '../account'; | ||
|
||
@Component({ | ||
selector: 'app-error', | ||
templateUrl: './error.component.html' | ||
}) | ||
export class ErrorComponent { | ||
export class ErrorComponent implements OnInit { | ||
errorMessage: string | undefined; | ||
error403: boolean | undefined; | ||
error404: boolean | undefined; | ||
|
||
constructor(private route: ActivatedRoute, private accountService: AccountService) {} | ||
|
||
ngOnInit() { | ||
this.route.data.subscribe(routeData => { | ||
if (routeData['error403']) { | ||
this.error403 = routeData['error403']; | ||
} | ||
if (routeData['error404']) { | ||
this.error404 = routeData['error404']; | ||
} | ||
if (routeData['errorMessage']) { | ||
this.errorMessage = routeData['errorMessage']; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Routes } from '@angular/router'; | ||
|
||
import { ErrorComponent } from './error.component'; | ||
|
||
export const errorRoutes: Routes = [ | ||
{ | ||
path: 'error', | ||
component: ErrorComponent, | ||
data: { | ||
authorities: [], | ||
pageTitle: 'error.title.string' | ||
} | ||
}, | ||
{ | ||
path: 'accessdenied', | ||
component: ErrorComponent, | ||
data: { | ||
authorities: [], | ||
pageTitle: 'error.title.string', | ||
error403: true | ||
} | ||
}, | ||
{ | ||
path: '404', | ||
component: ErrorComponent, | ||
data: { | ||
authorities: [], | ||
pageTitle: 'error.title.string', | ||
error404: true | ||
} | ||
}, | ||
{ | ||
path: '**', | ||
redirectTo: '/404' | ||
} | ||
]; |