title: Preload background-image using angularjs promises
body: <p>How can I preload css background-image's using angularjs promises
  What I want to do is something that I can use in this way:</p>
  
  <pre><code>link: function(scope, element, attrs){
      element.hide();
      url = attrs.url;
      preload(url).then(function(loadedImageURL){
          element.css({
              background-image: "url('" + loadedImageURL + "')"
          });
      });
      element.fadeIn();
  }
  </code></pre>
  
  <p>Please note that this is not a duplicate question of <a href="https://stackoverflow.com/questions/1373142/preloading-css-background-images">this one</a>.</p>