Ember Data Initialization Procedure

Why in the ember data library during initialization does the initializer "injectStore" be called before the initializer "store" (therefore, before the store has been registered)?

https://github.com/emberjs/data/blob/master/packages/ember-data/lib/initializers.js#L49

Ember.onLoad('Ember.Application', function(Application) {
  Application.initializer({
  name: "store",

  initialize: function(container, application) {
    application.register('store:main', application.Store || DS.Store);

    ...

-

https://github.com/emberjs/data/blob/master/packages/ember-data/lib/initializers.js#L97

  Application.initializer({
    name: "injectStore",
    before: "store",

    initialize: function(container, application) {
      application.inject('controller', 'store', 'store:main');
      application.inject('route', 'store', 'store:main');
      ...

Shouldn't be, register first and enter after?

+3
source share
1 answer

See which comment is from Stefan Penner

+2
source

All Articles