java-angular-web-app icon indicating copy to clipboard operation
java-angular-web-app copied to clipboard

Routing single page app with file protocol for electron and cordova

Open amanganiello90 opened this issue 6 years ago • 1 comments

The routing fails because the final '/#' is not redirect to index.html in the file protocol. Reproduce it in electron-client project clicking after npm start on Stats tab

amanganiello90 avatar Aug 08 '18 09:08 amanganiello90

The error is caused by source code of front end app in app.routing.ts:

 path: '',
    redirectTo: 'dashboard',
    pathMatch: 'full',

clicking on element with '#' element. For example:

  <a class="nav-link" href="#pablo">

The problem is that with the protocol file the blank space before '#' is not replaced with 'dashboard'. In fact the correct link should be:

  <a class="nav-link" href="dashboard#pablo">

amanganiello90 avatar Aug 08 '18 11:08 amanganiello90