I wanted to work with query string parameters along with the usual route parameters in an AngularJS application and have been following the solution in this post: how to pass querystring in angular routes?
The solution seems to work: Change the route first with
$location.path and then apply the query string parameters with
However, I came across a scenario where the route does not need to change but the query parameters need to.
does not work.
It seems that AngularJS is only notified for changes on the regular route parameters and not for changes in the query string parameters so if query string is the only thing that changes in the URL, the application does not respond to the navigation.
As verified with AngularJS 1.6.5, and according to the Plunkr by @JB-Nizet, the problem does not occur anymore. The question still remains for what I missed earlier that it did not work.
Marking it as resolved as it does not occur anymore.
Answered By – myTerminal
Answer Checked By – Marilyn (AngularFixing Volunteer)