Issue
In the old angularjs code and spring backend (both js and spring are build in to same war) we have tenant mode and normal mode. in normal mode the url looks like
http://localhost:4200/#!/dashboard
in tenant mode the url looks like.
http://localhost:4200/tenant/tenant1/#!/dashboard
to access the tenant mode we accessed as follows.
http://localhost:4200/tenant/tenant1
then in the back end we have filter to checks whether the url has /tenant/some-id and the backend return the index.html and then it is redirected to dashboard so the dashboard url looks like
http://localhost:4200/tenant/tenant1/#!/dashboard
Now i have migrated to angular 14 and backend is spring framework and now also both FE and BE are coupled into single war.
and when i try to access the same tenant in angular 14 using the url.
http://localhost:4200/tenant/tenant1
so i get the index.html from the backend but the url is getting changed to
http://localhost:4200/#/dashboard
instead of
http://localhost:4200/tenant/tenant1/#!/dashboard
I cant able to understand why /tenant/tenant1 is getting removed from the url. which was not the case of angularjs.
Solution
I have solved this problem by removing
<base href="/" />
from index.html of angular app.
Answered By - Suhail Ahmed
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.