lundi 16 octobre 2017

Ember dependency injection doesn't work in one of our services

We are using ember 2.7.

in one of our initializers/ there is a snippet to inject some app config to all code components

export default {
  ...

  initialize(application) {
    application.register('appServerData:global', Ember.Object.extend(serverAppData));
    ...
    application.inject('service', 'appServerData', 'appServerData:global');
  },
  ...
}

The problem is in one of our services services/local-storage.js, this.get('appServerData') always returns null. However in other services (or controllers, routes...), it will return app config.

I have no idea how to debug on this, any clue?




Aucun commentaire:

Enregistrer un commentaire