search(search, [paramValue]);
This method is getter / setter.
Return search part (as object) of current url when called without any parameter.
Change search part when called with parameter and return $location.
// given url http://example.com/#/some/path?foo=bar&baz=xoxo
var searchObject = $location.search();
// => {foo: 'bar', baz: 'xoxo'}
// set foo to 'yipee'
$location.search('foo', 'yipee');
// $location.search() => {foo: 'yipee', baz: 'xoxo'}
Parameters
| Param | Type | Details |
|---|---|---|
| search | stringObject.<string>Object.<Array.<string>> | New search params - string or hash object. When called with a single argument the method acts as a setter, setting the If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url. |
| paramValue (optional) | stringNumberArray.<string>boolean | If If If If |
Returns
Object |
If called with no arguments returns the parsed |
Please login to continue.