Skip to content

Instantly share code, notes, and snippets.

@vitaliy-bobrov
Created December 11, 2018 00:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitaliy-bobrov/633b1c21e510f923630208fa3c2a6c4f to your computer and use it in GitHub Desktop.
Save vitaliy-bobrov/633b1c21e510f923630208fa3c2a6c4f to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-not-found',
template: `
<h2>
404 - Page not found
</h2>
<p *ngIf="path">You might want to go to the <a [routerLink]="path">"{{ path }}" page</a></p>
`
})
export class NotFoundComponent implements OnInit {
path: string;
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.route.data.pipe(take(1))
.subscribe((data: { path: string }) => {
this.path = data.path;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment