Skip to content

Add support for injecting services in other services.  #5

@aerotoad

Description

@aerotoad

Issue: The dependency injection system is designed to work only from services to components. The @Inject() decorator might already work out of the box to inject a service into another, but the @Injectable() metadata object doesn't support a services array to keep them in the bundle.

Solutions:

  • Investigate if the @Inject() decorator already allows to inject services into other services.
  • Add a services array to the InjectableMetadata object like this:
@Injectable({
  selector: 'myService', 
  services: [MyOtherService]
})
export class MyService {

  @Inject() myOtherService: MyOtherService

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions