docs: function resolveComponentResources(resourceResolver) {
      // Store all promises which are fetching the resources.
      var urlFetches = [];
      // Cache so that we don't fetch the same resource more than once.
      var urlMap = new Map();
      function cachedResourceResolve(url) {
          var promise = urlMap.get(url);
          if (!promise) {
              var resp = resourceResolver(url);
              urlMap.set(url, promise = resp.then(unwrapResponse));
              urlFetches.push(promise);
          }
          return promise;
      }
      componentResourceResolutionQueue.forEach(function (component) {
          if (component.templateUrl) {
              cachedResourceResolve(component.templateUrl).then(function (template) {
                  component.template = template;
                  component.templateUrl = undefined;
              });
          }
          var styleUrls = component.styleUrls;
          var styles = component.styles || (component.styles = []);
          var styleOffset = component.styles.length;
          styleUrls && styleUrls.forEach(function (styleUrl, index) {
              styles.push(''); // pre-allocate array.
              cachedResourceResolve(styleUrl).then(function (style) {
                  styles[styleOffset + index] = style;
                  styleUrls.splice(styleUrls.indexOf(styleUrl), 1);
                  if (styleUrls.length == 0) {
                      component.styleUrls = undefined;
                  }
              });
          });
      });
      componentResourceResolutionQueue.clear();
      return Promise.all(urlFetches).then(function () { return null; });
  }