ember-preferences
ember-preferences copied to clipboard
ember-1.12.0 doesn't inject the service correctly
Right now you have to create a initializer with the following content to inject the service in ember-1.12.0 applications
export function initialize(container, application) {
['route', 'controller', 'component'].forEach((type) => {
application.inject(type, 'preferences', 'service:preferences');
});
}
export default {
name: 'register-ember-preferences',
initialize: initialize
};
Maybe we can have a initializer specific for ember-1.12.0 and include it in that case.
This is an example from the ember-cli.com documentation https://ember-cli.com/api/classes/Addon.html#method_treeForAddon
treeForAddon: function() {
var tree = this._super.treeForAddon.apply(this, arguments);
var checker = new VersionChecker(this);
var isOldEmber = checker.for('ember', 'bower').lt('1.13.0');
if (isOldEmber) {
tree = new Funnel(tree, { exclude: [ /instance-initializers/ ] });
}
return tree;
}