From f1d47824060122c926973fb59f483f97092fe605 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 25 Sep 2015 21:38:47 +0200 Subject: [PATCH] docs($http): link to the usage section when config is mentioned This makes it easier for beginners to find out what the config object looks like Closes #12949 --- src/ng/http.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ng/http.js b/src/ng/http.js index 6b553edc87f4..050e43a85722 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -425,13 +425,15 @@ function $HttpProvider() { * * * ## General usage - * The `$http` service is a function which takes a single argument — a configuration object — + * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} — * that is used to generate an HTTP request and returns a {@link ng.$q promise}. * * ```js - * // Simple GET request example : - * $http.get('/someUrl'). - * then(function(response) { + * // Simple GET request example: + * $http({ + * method: 'GET', + * url: '/someUrl' + * }).then(function(response) { * // this callback will be called asynchronously * // when the response is available * }, function(response) { @@ -440,8 +442,9 @@ function $HttpProvider() { * }); * ``` * + * There are also shortcut methods available: * ```js - * // Simple POST request example (passing data) : + * // Simple POST request shortcut example (passing data) : * $http.post('/someUrl', {msg:'hello word!'}). * then(function(response) { * // this callback will be called asynchronously @@ -655,7 +658,7 @@ function $HttpProvider() { * * There are two kinds of interceptors (and two kinds of rejection interceptors): * - * * `request`: interceptors get called with a http `config` object. The function is free to + * * `request`: interceptors get called with a http {@link $http#usage `config`} object. The function is free to * modify the `config` object or create a new one. The function needs to return the `config` * object directly, or a promise containing the `config` or a new `config` object. * * `requestError`: interceptor gets called when a previous interceptor threw an error or