Passing parameter inside $location.path in Angular

to add Parameters you should use $location.search() method so:

$location.path('/myURL/').search({param: 'value'});

$location methods are chainable.

this produce :

/myURL/?param=value

Leave a Comment