ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Use service registry in owner.lookup

Open ef4 opened this issue 3 years ago • 0 comments

This enhances the type of owner.lookup so it respects the (already existing) service type registry. This means that owner.lookup('service:foo') will have the correct type as long as you do:

declare module '@ember/service' {
  interface Registry {
    'foo': MyFooService;
  }
}

I recognize that this Registry might not be the long-term plan, but as long as it's defined and supported by the service injection decorators it seems helpful to also support it in lookup.

ef4 avatar Sep 08 '22 20:09 ef4