Answer the question
In order to leave comments, you need to log in
ActivatedRoute data.path returns undefined, in case of access to a non-existent route?
There is such an idea | GitHub repository
The essence of the idea: when accessing a non-existent route, offer a link that matches the name.
Route for 404:
{ path: '**', resolve: { path: PathResolveService }, component: NotFoundComponent }
this.route.data.pipe(take(1))
.subscribe((data: { path: string }) => {
this.path = data.path;
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question