-3

I enter url http://localhost/HTMLUS12706?key=1234 which redirects to http://localhost/HTMLUS12706/?key=1234#/index.

Now I need to remove ?key=1234 from url and update url to http://localhost/HTMLUS12706/#/index.

I have already tried these

        $location.search('key', null);
        $location.url($location.path());
        delete $location.$$search.key;
        $location.$$compose();
        $location.$$search = {};
        $location.search({});
User0806
  • 23
  • 3

2 Answers2

0

You can use $location service to get the url params. Like this,

$location.search().key
Muhammed Neswine
  • 2,028
  • 1
  • 20
  • 20
0

$location has a method called url( urlString ) which sets the path to urlString. Check this. The same method when called without params returns the current url path.