Skip to content

Commit

Permalink
Merge pull request #20355 from emberjs/service-registry
Browse files Browse the repository at this point in the history
[FEATURE] generate type registry entry in service blueprint
  • Loading branch information
chriskrycho committed Jan 19, 2023
2 parents 7d24b03 + cc58ddc commit 999619d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blueprints/service/files/__root__/__path__/__name__.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import Service from '@ember/service';

export default class <%= classifiedModuleName %>Service extends Service {}

// Don't remove this declaration: this is what enables TypeScript to resolve
// this service using `Owner.lookup('service:<%= dasherizedModuleName %>')`, as well
// as to check when you pass the service name as an argument to the decorator,
// like `@service('<%= dasherizedModuleName %>') declare altName: <%= classifiedModuleName %>Service;`.
declare module '@ember/service' {
interface Registry {
'<%= dasherizedModuleName %>': <%= classifiedModuleName %>Service;
}
}

0 comments on commit 999619d

Please sign in to comment.