function addIdentifier(locals, identifier, instance, name) {
      if (!(locals && isObject(locals.$scope))) {
        throw minErr('$controller')('noscp',
          "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
          name, identifier);
      }

      locals.$scope[identifier] = instance;
    }
@ngdoc service
@name $controller
@requires $injector

@param {Function|string} constructor If called with a function then it's considered to be the
   controller constructor function. Otherwise it's considered to be a string which is used
   to retrieve the controller constructor using the following steps:

   * check if a controller with given name is registered via `$controllerProvider`
   * check if evaluating the string on the current scope returns a constructor
   * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
     `window` object (not recommended)

   The string can use the `controller as property` syntax, where the controller instance is published
   as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
   to work correctly.

@param {Object} locals Injection locals for Controller.
@return {Object} Instance of given controller.

@description
`$controller` service is responsible for instantiating controllers.

It's just a simple call to {@link auto.$injector $injector}, but extracted into
a service, so that one can override this service with [BC version](https://gist.github.com/1649788).