I am using angular 6 with spring boot. i copied 'dist' file to spring boot project. and project running properly. but when i refresh the browser, it said 'white label error'. how i prevent from white label error.
Asked
Active
Viewed 6,265 times
0
-
Use the answer in https://stackoverflow.com/questions/44692781/configure-spring-boot-to-redirect-404-to-a-single-page-app – chrisinmtown Aug 14 '19 at 18:30
1 Answers
7
You should use RouterModule.forRoot(AppRoutes, {useHash: true}),
useHash As true
https://angular.io/api/common/HashLocationStrategy should help you understand.

Abhishek Ekaanth
- 2,511
- 2
- 19
- 40
-
-
1yes use this` [RouterModule.forRoot(routes, {useHash: true})]` instead of this `RouterModule.forRoot(routes)` – Abhishek Ekaanth Oct 29 '18 at 05:31
-
-
from your URL understanding you don't need to make any changes in base href but what is your deployed config – Abhishek Ekaanth Oct 29 '18 at 05:57
-
-
I am also facing the similar issue. I used the same configuration [RouterModule.forRoot(routes, {useHash: true})]. but even after that issue persists. – Bharat Sewani Mar 25 '19 at 09:29
-
-
After setting this configuration, I am able to navigate but only with '#' before every root route. When I use navigation through the link button then it is not working. – Peter S. Feb 25 '20 at 14:25
-