angularjs - Angular does not encode the semi-colon character in an url -



angularjs - Angular does not encode the semi-colon character in an url -

we need encoded semi-colon character in our url parameter angular not encode character.

the resource utilize looks this:

app.factory('testresource', ['$resource', function ($resource) { homecoming $resource('http://somedomain.com'); }]); app.run(['testresource', function (testresource) { testresource.query({ q: 'sin;sout' }); }]);

this result get:

http://somedomain.com/?q=sin;sout

we want url be:

http://somedomain.com/?q=sin%3bsout

but if pre-encode parameter before sending % char get's encoded this:

http://somedomain.com/?q=sin%253bsout

how can desired result? (http://somedomain.com/?q=sin%3bsout)

building on zeroflagl's reply 1 consider changing replace alter occurrences of semi-colon (as written replace first semi-colon):

url = url.replace(/;/g, '%3b');

angularjs

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -