404
parent
021ddf50c5
commit
b61a30daca
|
|
@ -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},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
<h1>404</h1>
|
||||
страница не найдена
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
:host{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
min-height: 500px;
|
||||
}
|
||||
|
|
@ -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<NotFoundComponentComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [NotFoundComponentComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(NotFoundComponentComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -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);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Loading…
Reference in New Issue