From ce98c39fbdbf8207e9fd3a9f95ebcc66d0c1c80c Mon Sep 17 00:00:00 2001 From: Alexis Feron Date: Sat, 25 Jan 2025 23:37:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Add=20404=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.routes.ts | 8 +++--- .../not-found/not-found.component.html | 25 +++++++++++++++++++ .../not-found/not-found.component.spec.ts | 23 +++++++++++++++++ .../not-found/not-found.component.ts | 8 ++++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 src/app/components/not-found/not-found.component.html create mode 100644 src/app/components/not-found/not-found.component.spec.ts create mode 100644 src/app/components/not-found/not-found.component.ts diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index a46a812..51b8add 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -2,9 +2,11 @@ import { Routes } from '@angular/router'; import { HomePageComponent } from './components/home-page/home-page.component'; import { LeafletMapComponent } from './components/leaflet-map/leaflet-map.component'; import { LoginPageComponent } from './components/login-page/login-page.component'; +import { NotFoundComponent } from './components/not-found/not-found.component'; export const routes: Routes = [ - {path: '', component: HomePageComponent}, - {path: 'map', component: LeafletMapComponent}, - {path: 'sign', component:LoginPageComponent} + { path: '', component: HomePageComponent }, + { path: 'map', component: LeafletMapComponent }, + { path: 'sign', component: LoginPageComponent }, + { path: '**', component: NotFoundComponent }, ]; diff --git a/src/app/components/not-found/not-found.component.html b/src/app/components/not-found/not-found.component.html new file mode 100644 index 0000000..d466530 --- /dev/null +++ b/src/app/components/not-found/not-found.component.html @@ -0,0 +1,25 @@ +
+
+
+

+ 404 +

+

+ Something's missing. +

+

+ Sorry, we can't find that page. You'll find lots to explore on the home + page. +

+ Back to Homepage +
+
+
diff --git a/src/app/components/not-found/not-found.component.spec.ts b/src/app/components/not-found/not-found.component.spec.ts new file mode 100644 index 0000000..5b65d9e --- /dev/null +++ b/src/app/components/not-found/not-found.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NotFoundComponent } from './not-found.component'; + +describe('NotFoundComponent', () => { + let component: NotFoundComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NotFoundComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NotFoundComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/not-found/not-found.component.ts b/src/app/components/not-found/not-found.component.ts new file mode 100644 index 0000000..4726f37 --- /dev/null +++ b/src/app/components/not-found/not-found.component.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-not-found', + imports: [], + templateUrl: './not-found.component.html', +}) +export class NotFoundComponent {}