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

Commit c398d7d

Browse files
jsyrjalapkozlowski-opensource
authored andcommitted
docs($resource): document port number escaping and fix typo
Closes #1243
1 parent d935338 commit c398d7d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ngResource/resource.js

+5-3
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 a URL with a port number (e.g.
23+
* `http://example.com:8080/api`), you'll need to escape the colon character before the port
24+
* number, like this: `$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)