I am working on an application that uses Ember.js and Handlebars.js. I have noticed that there can be a bit of a delay displaying templates when the page first loads. It makes sense that this happens since javascript has to create the HTML. When the page first loads it looks like a blank page has loaded, then suddenly everything appears.
Honestly, this is a problem that I can live with, but still it seems a bit awkward to me. I may just be over-analyzing things, but has anyone else noticed this and does anyone have a recommendation for how to make page loads appear more “natural”?
As I commented above, you can show a spinner while the page is rendering, loading data etc. As an example, below is a Mixin which shows a spinner until a View has rendered:
In the case where you want to wait for data to load (assuming that you use the router for showing views):
And mix it into your views:
Then define some CSS rules to show a loading spinner (or something) on an element having a
showSpinnerclass, and hiding it when it also has aisLoadedclass: