Created
December 11, 2018 00:00
-
-
Save vitaliy-bobrov/633b1c21e510f923630208fa3c2a6c4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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