ember-native-class-codemod icon indicating copy to clipboard operation
ember-native-class-codemod copied to clipboard

Injecting actions service

Open artemgurzhii opened this issue 6 years ago • 0 comments

Having:

// - app/
//   - services/
//     - actions/
//       - user.js
//     - dude.js

import Service, { inject as service } from '@ember/service';
export default Service.extend({
  actions: service('actions/user'),
});

Result:

import { action } from "@ember-decorators/object";
import Service from '@ember/service';
import { service } from "@ember-decorators/service";
export default class Dude extends Service {
  @service('actions/user')
  actions;
}

Expected:

import Service from '@ember/service';
import { service } from "@ember-decorators/service";
export default class Dude extends Service {
  @service('actions/user')
  actions;
}

artemgurzhii avatar Feb 25 '19 11:02 artemgurzhii