Currently, I am utilizing the ng-repeat
feature to fetch data from a $http.post
request and then save it to the $scope.data
variable.
<div ng-repeat="key in [] | range:data.pages">
<div class="pageBackground" id="page_{{ (key+1) }}" ng-style="{'background-image':'url(/images/{{data.id}}/{{(key+1)}}.png)'}">
<!-- more content here -->
</div>
The issue I'm encountering is that the .pageBackground
class tends to load prior to the background image appearing on the screen. My goal is to prevent anything from showing up until the background-image
has been successfully loaded, but so far, I haven't found a solution for this problem.
Could anyone offer some advice or suggestions on how to achieve this? Thank you!