Include support for TypeScript classes
szahn opened this issue · comments
Stuart Zahn commented
In TypeScript, to do dependency injection, we must statically include the $inject variable into each class. It would be great if ng-annotation would automatically recognize all TypeScript classes that are acting as Angular components and then inject the static $inject variable beside the constructor.
BEFORE INJECTION:
class MyDirective {
constructor($scope:any,service:MyService)
{
}
}
AFTER INJECTION:
class MyDirective {
static $inject = ["$scope","MyService"];
constructor($scope:any,service:MyService)
{
}
}
Stuart Zahn commented
Closing this issue and moving it to the ng-annotation repo: olov/ng-annotate#180