1

Angular quietly rewrites urls, but this specific case is causing problems for my app. Where would I look if I were trying to patch this particular case in angular?

Will it break a lot of stuff to force angular to behave this way?

concept47
  • 30,257
  • 12
  • 52
  • 74

2 Answers2

1

Directly from source:
https://github.com/angular/angular.js/blob/master/src/Angular.js#L854

Either recompile it, or just find the relevant part in your version of angularjs and change it.

It is caused by encodeURIComponent which is a native function. The way it is implemented by the browser is possibly standardized. It converts + to %2B along with many others.

You should then change your app's behavior.

Umur Kontacı
  • 35,403
  • 8
  • 73
  • 96
  • Though it may be better if you change your applications behavior, less specifity/customization across systems is always better. – Umur Kontacı Mar 18 '13 at 22:47
  • I saw that earlier too, that does does the reverse of what I want ... i.e it actually takes "%2B" and turns it into "+" for angular's purposes, I want it to stop taking "+" and turning it into "%2B" after the page has loaded – concept47 Mar 18 '13 at 22:57
  • Thanks that helped me figure it out! – concept47 Mar 19 '13 at 06:13
1

I figured out the fix from the answer above, all I had to do was go to this line https://github.com/angular/angular.js/blob/master/src/Angular.js#L873

and add a

replace(/%2B/gi, '+').

to the chain. Worked a treat! Thanks @fastreload!!!

concept47
  • 30,257
  • 12
  • 52
  • 74