How to get search parameters in non-html5 mode

I need to find the search parameters (after ? ), And not the hash parameters (after # ). The problem is that $location.search() switches between them based on html5Mode settings, which I don't want.

Without briefly parsing the URL, is there a way to get Angular to get rid of this information?

+7
angularjs
source share
1 answer

In a mode other than HTML5 $location.search() get information only after # , for example

For URL:

 http://google.com/dir?query=123#/route?a=456 

$ location.search () - {a: 456}

$ location.hash () is "" because if you define a route without HTML5, everything after # will become part of $location.path() , so the hash will no longer be selected.

+1
source share

All Articles