RevillWeb / angular-preload-image

A simple AngularJS module to make it easy to pre-load images.
MIT License
70 stars 29 forks source link

not pictured #2

Closed newmesiss closed 9 years ago

newmesiss commented 9 years ago

I am using this great module but can not get it to work. only shows me the image set in fall , I'm getting data from a REST API , and I think the view is loaded before the data is downloaded and later

<div class="hero slide-up"  preload-bg-image="
{{local.featured_image.attachment_meta.sizes.large.url}}" 
default-image="../img/material-graphite.jpg" 
fallback-image="../img/material3.jpg"></div>

controller

    $http({
        method: 'GET',
        url: 
    }).
    success(function (data, status, headers, config) {
         $scope.local = data;}
RevillWeb commented 9 years ago

@newmesiss could you provide an example image URL? You will also need to provide a relative path instead of "../img/material-graphite.jpg" for example.

newmesiss commented 9 years ago

I realized that the problem is that the $http.get request is made after the hearing and charged preload is not defined as a route and if not find any images