$location.hash() gets uriencoded sometimes, messing up my planned addressability

114 views
Skip to first unread message

Skylar Saveland

unread,
Apr 30, 2013, 1:55:37 AM4/30/13
to ang...@googlegroups.com
Hey All,

New to angular and loving it. Thanks for all the hard work.


Basically, I was hoping that a $location.hash() and a location.search() would make my state addressable. So, I could link a buddy, "hey! check out this combo! http://example.com/#/?9189=668.00&7010=128.00#7010,9189 "

Where I could link the url with a particular $location and rebuild the state for user2. But, if I paste such an address into Safari, for instance, the second "#" gets encoded to %23 and $location.hash() subsequently gives me "". Clicking a link from various degenerate softwares like Outlook, Notes, Messages, etc, gives me a broken uriencoded hash in chrome. If I paste and manually load the page in chrome, I can get my desired state. Android browser seems to encode even as it build the uri.

Is there a way I can be tolerant of this "%23" and turn it back into a hash or get $location to interpret it so that $location.hash would give me back "7010,9189" even for /#/?9189=668.00&7010=128.00%237010,9189?


Reply all
Reply to author
Forward
0 new messages