code: function (template) {
            if (fetchPromises[template]) {
              return fetchPromises[template];
            }
  
            fetchPromises[template] = $http.get(template, {
              cache: $templateCache
            });
  
            return fetchPromises[template].then(function (response) {
              return response.data;
            });
          }
docs: Private functions