All files / src/app/pages/not-found not-found.component.ts

100% Statements 12/12
100% Branches 2/2
100% Functions 1/1
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361x 1x 1x                   1x               7x 7x 7x   7x         7x 6x          
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { PageService, SeoService } from '../../services';
 
/**
 * Not Found Component
 */
@Component({
    selector: 'app-not-found',
    templateUrl: './not-found.component.html',
    styleUrls: ['./not-found.component.scss']
})
export class NotFoundComponent {
    /**
     * constructor of NotFoundComponent
     * @param pageService: PageService
     * @param router: Router
     * @param seo: SeoService
     */
    constructor(
        private readonly pageService: PageService,
        private readonly router: Router,
        private readonly seo: SeoService
    ) {
        this.pageService.initPage({
            title: '404 - Page not found',
            description: '404 - Page not found'
            // seo: {names: {robots: 'noindex, nofollow'}}
        });
        if (!this.router.url.endsWith('/http-404')) {
            this.seo.http404();
        }
    }
 
}