5

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

www.example.com/*variable

in which variable has a form of 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 get replaced with %252 and url becomes

www.example.com/word1%252Fword2

why it is happening and what can be the solution for this?

rnrneverdies
  • 15,243
  • 9
  • 65
  • 95
Ajeet Lakhani
  • 3,768
  • 2
  • 22
  • 37

1 Answers1

0

Have you tried setting location to false?

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

Since you're specifying URL parameters, perhaps they're being re-written in URL encoded format. The UI Router docs state

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

Michael D Johnson
  • 889
  • 1
  • 10
  • 21