From 22702736e997dcebeefba4d71e569bbbe2635d40 Mon Sep 17 00:00:00 2001 From: Valentin Vago Date: Mon, 7 Apr 2014 15:41:02 +0200 Subject: [PATCH] improve(docs): add $location.search() example Added a usage example for the retrieval of a specific value of the search (query) in a URL. --- src/ng/location.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ng/location.js b/src/ng/location.js index cd3548455a9e..cc9ffef66c7c 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -408,6 +408,16 @@ LocationHashbangInHtml5Url.prototype = * comma-separated value. If `paramValue` is `null`, the parameter will be deleted. * * @return {string} search + * + * @example If you want to get a specific value of the search, make sure you do not pass any arguments. + * + * + // This will return the `$location` object: + $location.search('what-you-want') + + // This will return give you the value you actually want: + $location.search()['what-you-want'] + * */ search: function(search, paramValue) { switch (arguments.length) {