File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ LocationUrl.prototype = {
335335 if ( paramValue === null ) {
336336 delete this . $$search [ search ] ;
337337 } else {
338- this . $$search [ search ] = encodeUriQuery ( paramValue ) ;
338+ this . $$search [ search ] = paramValue ;
339339 }
340340 } else {
341341 this . $$search = isString ( search ) ? parseKeyValue ( search ) : search ;
Original file line number Diff line number Diff line change @@ -330,6 +330,19 @@ describe('$location', function() {
330330 expect ( url . search ( ) ) . toEqual ( { 'i j' : '<>#' } ) ;
331331 expect ( url . hash ( ) ) . toBe ( 'x <>#' ) ;
332332 } ) ;
333+
334+
335+ it ( 'should return decoded characters for search specified in URL' , function ( ) {
336+ var locationUrl = new LocationUrl ( 'http://host.com/?q=1%2F2%203' ) ;
337+ expect ( locationUrl . search ( ) ) . toEqual ( { 'q' : '1/2 3' } ) ;
338+ } ) ;
339+
340+
341+ it ( 'should return decoded characters for search specified with setter' , function ( ) {
342+ var locationUrl = new LocationUrl ( 'http://host.com/' ) ;
343+ locationUrl . search ( 'q' , '1/2 3' ) ;
344+ expect ( locationUrl . search ( ) ) . toEqual ( { 'q' : '1/2 3' } ) ;
345+ } ) ;
333346 } ) ;
334347 } ) ;
335348
You can’t perform that action at this time.
0 commit comments