File

src/app/shared/components/not-found/not-found.component.ts

Implements

OnInit

Metadata

selector app-not-found
styleUrls ./not-found.component.scss
templateUrl ./not-found.component.html

Index

Properties
Methods

Constructor

constructor(route: ActivatedRoute)
Parameters :
Name Type Optional
route ActivatedRoute No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

url
Type : string
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-not-found',
  templateUrl: './not-found.component.html',
  styleUrls: ['./not-found.component.scss'],
})
export class NotFoundComponent implements OnInit {
  url: string;

  constructor(private route: ActivatedRoute) {}

  ngOnInit(): void {
    this.url = this.route.snapshot.url
      .map(x => x.path)
      .toString()
      .replace(/,/g, '/');
  }
}
<div class="container-route-not-found">
  <h6 class="text-hint" data-cy="not-found-hint">
    Route <span class="text-danger">/{{ url }}</span> wurde nicht gefunden
  </h6>
</div>

./not-found.component.scss

.container-route-not-found {
  max-width: 900px;
  margin: 100px auto 0 auto;
  text-align: center;
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""