mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
fix(ngResource): don't append number to '$' in url param value when encoding URI
Previously, if a URL parameter value included a $, it would replace the dollar sign with a literal '$1' for mysterious reasons. Using a function rather than a replacement string circumvents this behaviour and produces a more expected result. Closes #6003 Closes #6004
This commit is contained in:
@@ -178,9 +178,11 @@ describe("resource", function() {
|
||||
|
||||
$httpBackend.expect('GET', '/Path/foo%231').respond('{}');
|
||||
$httpBackend.expect('GET', '/Path/doh!@foo?bar=baz%231').respond('{}');
|
||||
$httpBackend.expect('GET', '/Path/herp$').respond('{}');
|
||||
|
||||
R.get({a: 'foo#1'});
|
||||
R.get({a: 'doh!@foo', bar: 'baz#1'});
|
||||
R.get({a: 'herp$'});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user