I want to set a header 404 on current page when there is no route matching my array.
Other wise I think it will be a issue in SEO and unknown pages will also be added to search engines.
I want to set a header 404 on current page when there is no route matching my array.
Other wise I think it will be a issue in SEO and unknown pages will also be added to search engines.
2
Answers
Angular has a route path –
**
, which will be accessed if no route was matched. You can use this path to show404 error page
component.you can do like this , add below in your rout.ts file and create
notfoundComponent