2

In my Ember 2 web app I have a couple of services (notify for UX feedback messaging and intl for translations) that are used everywhere. I wonder whether there is any drawbacks in injecting them in any controller (and even every route) through an initializer this way:

/app/initializers/notify-intl.js

export default {
  name: 'notify-intl',
  initialize: function (container, application) {
    application.inject('controller', 'intl', 'service:intl');
    application.inject('controller', 'notify', 'service:notify');
  }
};

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.