Kagami / gulp-ng-annotate

:pushpin: Add angularjs dependency injection annotations with ng-annotate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include support for TypeScript classes

szahn opened this issue · comments

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)
      {

      }
 }

Closing this issue and moving it to the ng-annotation repo: olov/ng-annotate#180