angular icon indicating copy to clipboard operation
angular copied to clipboard

Is there a way to remove the '#' in routing

Open DartViet opened this issue 5 years ago • 1 comments

I was following to tutorial, and recently I notice the '#' in url path (ex: localhost:4040/#/heroes ) cause quite a lot of troubles.

I'm working on authentication using Microsoft Azure. It asked for the return uri, and if I input the return uri with the '#', error message always pops up. (in my case: http://localhost:8080/#/msauth/ never works, but http://localhost:8080/ works normally.

I open postman, try to add key-value in parameter, and if there is a '#' symbol in the url... it does like this:

http://localhost:8080/?param1=value1&param2=value2#/heroes

The bottom line, I think the '#' is the problem, and it would be nice to get rid of it... I just don't know how.

In order to route, prioritize, and act on this as soon as possible please include:

  • [x] Dart SDK Version (2.9.2)
  • [x] AngularDart Version ( MASTER)
  • [x] Whether you are using Windows
  • [x] Whether you are using Chrome

DartViet avatar Sep 02 '20 05:09 DartViet

You have to provide the PathLocationStrategy instead of the HashLocationStrategy then it will serve without the #, but then you have to handle the non default routes by a server-

valakis avatar Sep 16 '20 11:09 valakis