How to ignore route param in location

Issue

I am navigating to next page as:

$location.path("XXX/YYYY/");

current view has URL parameter as:

http://www.go.com/?a=true;

now when I navigate, it has XXX/YYYY/"?a=true;

I have tried :

delete $routeParams.a;

and

delete $location.$$search.a;

But it doesn’t work. It doesn’t remove the parameter.

How to set routeparam when navigating to a different page?

Solution

Following change fixed my issue :

 delete $location.$$search.a;
 $location.replace().path("XXX/YYYY/");

 config: {           
            reloadOnSearch: false
         }

Answered By – Furqan Misarwala

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.