infor-cloud / m3-h5-sdk

https://infor-cloud.github.io/m3-h5-sdk/
34 stars 20 forks source link

Angular Routing bug on odin generated project #144

Closed Larynn closed 1 year ago

Larynn commented 1 year ago

Describe the bug Routing concatenates to previous url upon reload of page.

To Reproduce Steps to reproduce the behavior:

1.Create a simple routing model sample structure: app-component | child1 | child2

  1. Click on child1 router link. url will show: localhost8080/child1
  2. Reload
  3. Click on child2 router link. url will show: localhost8080/child1/child2

Expected behavior after reload and clicking child2 it url should be localhost8080/child2

Version m3-odin: 5.0.0 m3-odin-anular: 5.0.0

Additional context

anhallbe commented 1 year ago

Is this a project created with odin new or is it one of the sample projects?

A new project created with odin new doesn't even import the RoutingModule or declare any routes, so I'm finding it hard to see how the project creation is relevant here?

swuendri commented 1 year ago

Dear @Larynn,

this isn't a bug of odin project generation. If you add angular routing to project choose HashLocationStrategy. I found the description in https://codecraft.tv/courses/angular/routing/routing-strategies/ very helpful to understand the differences. And reloading a deployed M3 H5 application will only work with HashLocationStrategy.