Improve documentation for TypeScript support
See original GitHub issueIn 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)
{
}
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Documenting Your TypeScript Projects: There Are Options
In this article, I'm going to cover a few tools that will help you document your TypeScript projects. Good code does not need...
Read more >JSDoc Reference - TypeScript: Documentation
JSDoc Reference. The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >TypeScript + JSDoc = better-docs - Wojciech Krysiak - Medium
Documentation generated by better-docs looks very well (screenshots below) · It is based on JSDoc — a stable tool created a long time...
Read more >Improve README documentation for TypeScript usage #467
ts-node supports third-party transpilers as plugins. Transpilers such as swc can transform TypeScript into JavaScript much faster than the ...
Read more >Generating Documentation for TypeScript Projects
These annotations are all optional and the more you add, the more the compiler can help you. Compiling the TypeScript version results in ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The README is now very clear that it is preferred to use
"ngInject";
with TypeScript. ClosingI see that the readme states that TypeScript is supported, however a sub-heading with sample code on annotating a constructor would have been useful.