AugluarJS truncating end equal sign

AngularJS truncates trailing equal signs when routing them. I have a base64 string that needs to be added as a request parameter to the url (route)

ex: http://example.com/#!/updatepassword?code=NnuW3q49QW38Mf-Cg==

it loads like:    http://example.com/#!/updatepassword?code=NnuW3q49QW38Mf-Cg

Is there a workaround for this?

+4
source share
1 answer

, =. , - .

, :

var query = "code=NnuW3q49QW38Mf-Cg==";
$location.url("/some/path?" + encodeURIComponent(query));

encodeURIComponent() , - = %3D, . .

, URL-, $location.search():

$location.search("code", "NnuW3q49QW38Mf-Cg==");

, . :

$location.search("code=NnuW3q49QW38Mf-Cg==");

= , .


Angular parseKeyValue() , . , =. .

.search() , , parseKeyValue() , .search(). , , - .

Peeking :

$location.search({"code": "NnuW3q49QW38Mf-Cg=="});
+3

All Articles