« All deprecation guides

Deprecation Guide for Importing inject from @ember/service

until: 7.0.0
id: importing-inject-from-ember-service

Importing inject from @ember/service is deprecated. Please import service instead.

Example:

my-route.js
import { Route } from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { service } from '@ember/service';

export default class MyRoute extends Route {
  @service store;
}

You can use the ember-codemod-remove-inject-as-service codemod, to fix all violations.