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 {}
+ Something's missing. +
+ Sorry, we can't find that page. You'll find lots to explore on the home + page. +