Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.03 KB

no-private-routing-service.md

File metadata and controls

50 lines (35 loc) · 1.03 KB

no-private-routing-service

Disallow the use of the private -routing service.

There has been a public router service since Ember 2.16 and using the private routing service should be unnecessary.

Examples

Examples of incorrect code for this rule:

import Component from '@ember/component';
import { inject as service } from '@ember/service';

export default Component.extend({
  routing: service('-routing')
});
import Component from '@ember/component';

export default class MyComponent extends Component {
  @service('-routing') routing;
}

Examples of correct code for this rule:

import Component from '@ember/component';
import { inject as service } from '@ember/service';

export default Component.extend({
  router: service('router')
});
import Component from '@ember/component';

export default class MyComponent extends Component {
  @service
  router;
}

References

Router RFC