src/app/shared/components/not-found/not-found.component.ts
selector | app-not-found |
styleUrls | ./not-found.component.scss |
templateUrl | ./not-found.component.html |
Properties |
Methods |
constructor(route: ActivatedRoute)
|
||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
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;
}