1

What is the ember-cli way of displaying a static message to indicate that the emper-app itself (vendor.js) is loading (being downloaded)?

Current situation

  • Index.html is blank pre vendor.js download

Goal

  • Display something to the user while vendor.js is downloading to avoid making them leave the page while its loading.

Solution idea (not yet tested, not yet known if it's a good solution)

  1. Create a named div in the index.html file
  2. Hide it on ember initialization
consideRatio
  • 1,091
  • 13
  • 19
  • create an initializer that runs once all other initializers have ran? –  Feb 25 '15 at 16:13
  • yeah, that would be a way to implement the solution idea. Any nice way of making an initializer once the others have run btw? – consideRatio Feb 25 '15 at 16:28
  • you can set before and after so I guess you can have a pop there - no guarantees it will run before all the 3rd party initializers have ran but i'd start there –  Feb 25 '15 at 16:29
  • Seems I need to name all the other initializers to accomplish that. I resorted to invoking the "hide the div" code in my applicationroutes renderTemplate before calling this._super – consideRatio Feb 25 '15 at 16:43

1 Answers1

1

Have you tried "loading" route in ember? You can place any template you want to display during loading into "app/routes/loading.hbs". If you are using pods, place it into "app/pods/loading/template.hbs". If you want more detailed instructions, see: http://emberjs.com/guides/routing/loading-and-error-substates/

fidlip
  • 71
  • 5
  • 1
    Sorry for the confusion but I meant the loading of the vendor.js file containing the ember code (assuming ember-cli project) – consideRatio Feb 26 '15 at 22:36