1

This question may seem a duplicate and it can be. But I have tried the below solutions which do not seem to work:

  1. $location.search('lang', null)
  2. $location.url($location.path());
  3. $location.$$search = {};

Question:

When I first redirected to my angular app Url looks like:

http://subdomain.domain.com/?lang=en-US#/UserList

As it hits my Asp.Net controller(on BeginExecuteReady) I process the language and set culture. And now want to remove the param and question-madrk i.e. "?lang=en-US".

And I have HTML5Mode off for the app. Some angular threads suggests its not possible as:

changing anything but the hash without html5 history will result in a browser reload.

Please guide me towards light.

Language Lassi
  • 2,520
  • 21
  • 24
  • 1
    AFAIK, this is not possible when HTML5Mode is off. This workaround might help: http://stackoverflow.com/a/24129356/3563439. – masa Nov 18 '15 at 19:33

1 Answers1

1
$window.location.search = ''

This is the code that worked for me.

Gwen Au
  • 859
  • 9
  • 10