code: function loadNext(moduleName) {
                              moduleCache.push(moduleName);
                              modulePromises[moduleName] = deferred.promise;
                              self._loadDependencies(moduleName, localParams).then(function success() {
                                  try {
                                      justLoaded = [];
                                      _register(providers, moduleCache, localParams);
                                  } catch (e) {
                                      self._$log.error(e.message);
                                      deferred.reject(e);
                                      return;
                                  }
  
                                  if (modulesToLoad.length > 0) {
                                      loadNext(modulesToLoad.shift()); // load the next in list
                                  } else {
                                          deferred.resolve(res); // everything has been loaded, resolve
                                      }
                              }, function error(err) {
                                  deferred.reject(err);
                              });
                          }
docs: clean copy