examples/weather/angular.js
function(search, paramValue) {
    switch (arguments.length) {
      case 0:
        return this.$$search;
      case 1:
        if (isString(search)) {
          this.$$search = parseKeyValue(search);
        } else if (isObject(search)) {
          this.$$search = search;
        } else {
          throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.');
        }
        break;
      default:
        if (paramValue == undefined || paramValue == null) {
          delete this.$$search[search];
        } else {
          this.$$search[search] = paramValue;
        }
    }

    this.$$compose();
    return this;
  }
function(search, paramValue) {
    switch (arguments.length) {
      case 0:
        return this.$$search;
      case 1:
        if (isString(search)) {
          this.$$search = parseKeyValue(search);
        } else if (isObject(search)) {
          this.$$search = search;
        } else {
          throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.');
        }
        break;
      default:
        if (paramValue == undefined || paramValue == null) {
          delete this.$$search[search];
        } else {
          this.$$search[search] = paramValue;
        }
    }

    this.$$compose();
    return this;
  }
@ngdoc method
@name ng.$location#search
@methodOf ng.$location

@description
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`.

@param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or hash object. Hash object
may contain an array of values, which will be decoded as duplicates in the url.
@param {string=} paramValue If `search` is a string, then `paramValue` will override only a
single search parameter. If the value is `null`, the parameter will be deleted.

@return {string} search