Skip to content
New issue

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

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

Already on GitHub? # to your account

Support TypeScript-style Parameter Decorators for DI #102

Open
MikeRyanDev opened this issue Nov 26, 2015 · 1 comment
Open

Support TypeScript-style Parameter Decorators for DI #102

MikeRyanDev opened this issue Nov 26, 2015 · 1 comment

Comments

@MikeRyanDev
Copy link
Member

Support this type of injection:

import {Inject, Injectable} from 'ng-forward';
import MyService from './my-service';

@Injectable()
class AnotherService{
  constructor(
     @Inject('$http') private $http: angular.IHttp,
     private myService: MyService
  ){ }
}

This would add behavior to the @Inject decorator to support parameters in the constructor. It would not break existing @Inject functionality. We would also need to change the Module class to support reading design:type metadata when looking for $inject metadata on a provider.

@shripalsoni04
Copy link

+1 for this very useful feature

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants