Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 610ab45

Browse files
committed
Document port number escaping in URL for $resource
Related to issues #1664, #1243 and #942. Also fixed one typo.
1 parent f8b7559 commit 610ab45

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ngResource/resource.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
* the need to interact with the low level {@link ng.$http $http} service.
2020
*
2121
* @param {string} url A parameterized URL template with parameters prefixed by `:` as in
22-
* `/user/:username`.
22+
* `/user/:username`. If you are using URL with a port number (e.g. `http://example.com:8080/api`),
23+
* you'll need to escape colon character before the port number, like this:
24+
* `$resource('http://example.com\\:8080/api')`.
2325
*
2426
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
2527
* `actions` methods. If any of the parameter value is a function, it will be executed every time
26-
* when a param value needs to be obtained for a request (unless the param was overriden).
28+
* when a param value needs to be obtained for a request (unless the param was overriden).
2729
*
2830
* Each key value in the parameter object is first bound to url template if present and then any
2931
* excess keys are appended to the url search query after the `?`.
@@ -229,7 +231,7 @@ angular.module('ngResource', ['ng']).
229231
};
230232

231233
/**
232-
* We need our custom mehtod because encodeURIComponent is too aggressive and doesn't follow
234+
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
233235
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
234236
* segments:
235237
* segment = *pchar

0 commit comments

Comments
 (0)