docs: function(template, templateUrl) {
            var deferred = $q.defer();
  
            if (template) {
              deferred.resolve(template);
  
            } else if (templateUrl) {
              //  Check to see if the template has already been loaded.
              var cachedTemplate = $templateCache.get(templateUrl);
  
              if (cachedTemplate) {
                deferred.resolve(cachedTemplate);
  
              } else {
                //  If not, let's grab the template for the first time.
                $http.get(templateUrl).then(function(result) {
  
                  //  Save template into the cache and return the template.
                  $templateCache.put(templateUrl, result.data);
  
                  deferred.resolve(result.data);
  
                }, function(error) {
                  deferred.reject(error);
                });
              }
  
            } else {
              deferred.reject('No template or templateUrl has been specified.');
            }
  
            return deferred.promise;
          }