38248: Added PageNotFound component

This commit is contained in:
Lotte Hofstede
2017-01-12 15:18:15 +01:00
parent 8cd58f8243
commit 82a379df3c
4 changed files with 16 additions and 5 deletions

View File

@@ -1,13 +1,19 @@
{ {
"title": "DSpace", "title": "DSpace",
"nav": { "nav": {
"home": "Home" "home": "Home"
}, },
"example": { "example": {
"with": { "with": {
"data": "{{greeting}}, {{recipient}}!" "data": "{{greeting}}, {{recipient}}!"
} }
},
"404": {
"help": "We can't find the page you're looking for. The page may have been moved or deleted. You can use the button below to get back to the home page. ",
"page-not-found": "page not found",
"link": {
"home-page": "Take me to the home page"
}
} }
} }

View File

@@ -1,10 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forChild([ RouterModule.forChild([
{ path: '', redirectTo: '/home', pathMatch: 'full' } { path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: '**', pathMatch: 'full', component: PageNotFoundComponent},
]) ])
], ],
}) })

View File

@@ -1,11 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { HomeModule } from './home/home.module'; import { HomeModule } from './home/home.module';
import { SharedModule } from './shared/shared.module'; import { SharedModule } from './shared/shared.module';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { HeaderComponent } from './header/header.component'; import { HeaderComponent } from './header/header.component';
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
import { StoreModule } from "@ngrx/store"; import { StoreModule } from "@ngrx/store";
import { RouterStoreModule } from "@ngrx/router-store"; import { RouterStoreModule } from "@ngrx/router-store";
@@ -17,7 +19,8 @@ import { effects } from './app.effects';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
HeaderComponent HeaderComponent,
PageNotFoundComponent
], ],
imports: [ imports: [
SharedModule, SharedModule,

View File

@@ -10,5 +10,5 @@
* ]; * ];
**/ **/
export const routes: string[] = [ export const routes: string[] = [
'home' 'home', '**'
]; ];