I have a simple Angular http.get:
app.factory('countriesService', function($http) { return { getCountryData: function(done) { $http.get('/resources/json/countries.json') .success(function(data) { done(data);}) .error(function(error) { alert('An error occured'); }); } } });
Example .JSON:
{ "NoCities": 66, "Balance": 2103, "Population": 63705000, "CityInfo": [ { "CityName": "London", "CityPopulation": "7825200", "Facts": { "SubFact1": "xzy", "SubFact2": "xzy", "SubFact3": "xzy", "SubFact4": "xzy", "SubFact5": "xzy" }, }, { "CityName": "Manchester", "CityPopulation": "2584241", "Facts": { "SubFact1": "abc", "SubFact2": "abc", "SubFact3": "abc", "SubFact4": "abc" }, } ], "SubmitInfo": null, "FormAction": null, "FormController": null, }
I noticed that when my page runs the .length, it may sometimes take a while to load the data, for example:
<div> <a>Countries</a> : {{Countries.length}} </div>
Does Angular have a wait / load form icon that I could show while the data in the DIV is populating?
Ideally, something is lightweight and does not require loading a library (my application also uses jQuery)
thanks