ember-preloader
You put your preloader in, you take your preloader out, You put your preloader in, and you shake it all about...
This addon allows you to render files directly in to the index.html on the initial build, then removes them from the DOM once your app has loaded. Useful for adding a preloading screen before the initial app is downloaded.
Install
ember install ember-preloader
Usage
The addon leverages the contentFor
helper. In your app's ember-cli-build.js define your options hash, either using the existing contentFor
hooks or your own:
var app = defaults preloader: head: 'preload.css' body: 'preload.html' 'custom-hook': 'preload.js' 'custom-hook2': 'preload2.js' ;
If you've used custom hooks, add them to your index.html file:
{{content-for 'custom-hook'}}{{content-for 'custom-hook2'}}
Finally, import the mixin into your application route:
;;
Example
ember-cli-build.js:
var app = defaults preloader: head: 'preload.css' body: 'preload.html' 'body-footer': 'preload.js' ;
Output: