question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

export features as standard ember service

See original GitHub issue

trying to inject the features service into other components using Ember.inject.service() raises an error:

export default Ember.Component.extend({
  features: Ember.inject.service()
});

Uncaught Error: Attempting to inject an unknown injection: service:features

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
kategenglercommented, Mar 9, 2016

I’ve now made it a standard service (committed to master, to be released soon), but it will be a breaking change.

0reactions
jamesarosencommented, Feb 17, 2016

As a workaround, what about this?

// app/instance-initializers/ember-feature-flags-service.js
export default {
  name: 'ember-feature-flags-service',

  initialize({ registry }) {
    const features = registry.lookup('features:-main');
    registry.register('service:features', features, { singleton: true, instantiate: false });
  }
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview - Services - Ember Guides
Services are useful for features that require shared state or persistent connections. ... import Service from '@ember/service'; export default class ...
Read more >
minutebase/ember-can: Simple authorisation addon ... - GitHub
Simple authorisation addon for Ember apps. Contribute to minutebase/ember-can development by creating an account on GitHub.
Read more >
Services - ember-cli-typescript
Ember Services are global singleton classes that can be made available to different parts of ... export default class ShoppingCartService extends Service {....
Read more >
Ember-can | Simple authorisation addon for Ember apps
Simple authorisation addon for Ember apps. ... Ember-can ... import { inject as service } from '@ember/service'; export default Route.extend({ can: ...
Read more >
The State of the Ember Addon Ecosystem in 2019 - Salsify
Runtime Runtime addons provide features that will be present in the final application, these include Ember components like ember-power-select ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found