code: function(name) {
                  // If something is already in the registry return its promise ASAP.
                  // This is the case where you might want to get a registry item in an event handler.
                  if (registry[name]) {
                      return registry[name].promise;
                  }
  
                  // If we dont already have a registry item create one. This covers the
                  // case where the directive is nested inside the controller. The parent
                  // controller will be executed and gets a promise that will be resolved
                  // later when the item is registered
                  var deferred = $q.defer();
  
                  registry[name] = deferred;
  
                  return deferred.promise;
              }
docs: @ngdoc function
  @name get
  @methodOf esri.core.factory:esriRegistry
  
  @description
  Get the MapView or SceneView instance registered with the given name.
  See {@link esri.map.directive:esriMapView esriMapView} or
  {@link esri.map.directive:esriSceneView esriSceneView}
  for info on how to register a map using the `register-as` attribute.
  
  @param {String} name The name that the view was registered with.
  
  @return {Promise} Returns a $q style promise which is resolved with the view once it has been loaded.