Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] generate type registry entry in service blueprint #20355

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions blueprints/service/files/__root__/__path__/__name__.ts
@@ -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;
}
}