diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 5214685..07ef722 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -12,6 +12,8 @@ import { Tk023Component } from './projects/tk023/tk023.component'; import { Tk465Component } from './projects/tk465/tk465.component'; import { ScvgComponent } from './projects/scvg/scvg.component'; import { pipe_prodComponent } from './projects/pipe_prod/pipe_prod.component'; +import { NotFoundComponentComponent } from './not-found-component/not-found-component.component'; + export const routes: Routes = [ {path: "", component: HomeComponent}, @@ -26,5 +28,6 @@ export const routes: Routes = [ {path:'projects/tk023', component: Tk023Component}, {path:'projects/tk465', component: Tk465Component}, {path:'projects/gazprom', component: ScvgComponent}, - {path:'projects/pipe_prod', component: pipe_prodComponent} + {path:'projects/pipe_prod', component: pipe_prodComponent}, + {path: '404', component: NotFoundComponentComponent}, ]; diff --git a/src/app/not-found-component/not-found-component.component.html b/src/app/not-found-component/not-found-component.component.html new file mode 100644 index 0000000..caf4c00 --- /dev/null +++ b/src/app/not-found-component/not-found-component.component.html @@ -0,0 +1,2 @@ +

404

+страница не найдена diff --git a/src/app/not-found-component/not-found-component.component.scss b/src/app/not-found-component/not-found-component.component.scss new file mode 100644 index 0000000..7176701 --- /dev/null +++ b/src/app/not-found-component/not-found-component.component.scss @@ -0,0 +1,8 @@ +:host{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + min-height: 500px; +} \ No newline at end of file diff --git a/src/app/not-found-component/not-found-component.component.spec.ts b/src/app/not-found-component/not-found-component.component.spec.ts new file mode 100644 index 0000000..a18eb43 --- /dev/null +++ b/src/app/not-found-component/not-found-component.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NotFoundComponentComponent } from './not-found-component.component'; + +describe('NotFoundComponentComponent', () => { + let component: NotFoundComponentComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NotFoundComponentComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NotFoundComponentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/not-found-component/not-found-component.component.ts b/src/app/not-found-component/not-found-component.component.ts new file mode 100644 index 0000000..82365b9 --- /dev/null +++ b/src/app/not-found-component/not-found-component.component.ts @@ -0,0 +1,21 @@ +import { Component, Inject, OnInit, Optional, PLATFORM_ID } from '@angular/core'; +import { Request, Response } from 'express'; +import { isPlatformServer } from '@angular/common'; +@Component({ + selector: 'app-not-found-component', + standalone: true, + imports: [], + templateUrl: './not-found-component.component.html', + styleUrl: './not-found-component.component.scss' +}) +export class NotFoundComponentComponent { + // constructor(@Optional() @Inject(Request) private request: Request, + // @Optional() @Inject(Response) private response: Response, + // @Inject(PLATFORM_ID) private platformId: any){} + // ngOnInit() { + + // if (isPlatformServer(this.platformId)) { + // this.response.status(404); + // } + // } +}