'/' replaced with% 252F in url when reloading $ state in angular

I am using ui-router in angularjs for routing. I have url something like this

www.example.com/*variable

      

in which the variable has the form word1/word2

So the url becomes www.example.com/word1/word2

but when i apply

$state.reload(); or 
$state.go($state.current,{},reload:true);

      

The forward slash is replaced with %252

and the url becomes

www.example.com/word1%252Fword2

      

why is this happening and what could be the solution to this?

+3


source to share


1 answer


Have you tried setting location to false?

$state.go($state.current,{},{reload:true, location: false});



Since you are specifying URL parameters, it is possible that they are being rewritten in URL encoded format. UI informs

location Boolean or "replace" (default true) if true will update the URL in the location bar if false. If the string is "replace", it will update the url and also replace the last record history.

0


source







All Articles