Situation: We use AngularJS Material. It takes some time (up to several seconds) to render the data into the design.
Question: For this wait duration, we would like to show a loading element to signal the user that the website is working. However, what is the event for that? How can this be accomplished?
What we tried so far (and did not work):
$scope.loading = true; //shows a loading throbber
$http.get('/data.json').success(function(afts){
$scope.afts = afts;
$scope.loading = false; //hides the loading throbber
});
However, this only shows the loading throbber for a fraction of a second because the time consuming part is not loading the data, but rendering it (what happens when assigning the data/afts to the $scope).
Is there another event which is triggered when the rendering of this new data is complete?
How it should look like while rendering the data:
And this is how it looks now:
Steps to reproduce:
- Visit [example no longer available. AngularJS was too slow, we replaced it with a faster technology]
- Enter a location where it says "Mein Start-Ort (Adresse) in the top left corner
- Choose a location from the dropdown or hit "ENTER"
- Then you will experience a gap of a view seconds until you see the items listed below. During that time, a loading throbber should appear, but does not yet.