TSK-835: enabled hashrouting to find resources from a context path

This commit is contained in:
Mustapha Zorgati 2019-05-30 00:29:45 +02:00
parent c9f03cc563
commit ce2f98f2cb
2 changed files with 2 additions and 13 deletions

View File

@ -53,7 +53,7 @@ const appRoutes: Routes = [
@NgModule({
imports: [
RouterModule.forRoot(
appRoutes
appRoutes, {useHash: true}
)
],
exports: [

View File

@ -4,18 +4,7 @@
<head>
<meta charset="utf-8">
<title>Taskana</title>
<base href="/" id="baseHref">
<!--This is used for change the base Href of the application, if the application is not located at / folder it will change the href path to whatever precedes to taskana in the url
for instance if the application is running at http://localhost:8080/some-path/taskana, the href will be some-path-->
<script>
(function () {
const hrefUrl = window.location.pathname.split('taskana')[0];
document.getElementById('baseHref').href =
window.location.port != 4200 ?
hrefUrl :
"/";
})();
</script>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/icons/taskana.png">
</head>