Application#domReady()

domReadyprivate

Defined in packages/ember-application/lib/system/application.js:446

This is the autoboot flow:

  1. Boot the app by calling this.boot()
  2. Create an instance (or use the __deprecatedInstance__ in globals mode)
  3. Boot the instance by calling instance.boot()
  4. Invoke the App.ready() callback
  5. Kick-off routing on the instance

Ideally, this is all we would need to do:

_autoBoot() {
  this.boot().then(() => {
    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();
    return instance.boot();
  }).then((instance) => {
    App.ready();
    instance.startRouting();
  });
}

Unfortunately, we cannot actually write this because we need to participate in the "synchronous" boot process. While the code above would work fine on the initial boot (i.e. DOM ready), when App.reset() is called, we need to boot a new instance synchronously (see the documentation on _bootSync() for details).

Because of this restriction, the actual logic of this method is located inside didBecomeReady().

doc_EmberJs
2016-11-30 16:48:27
Comments
Leave a Comment

Please login to continue.