Include comments with generated code
For folks who are new to Angular, generated comments along with generated code would be very helpful. Comments could contain a brief explanation of what the file is for (e.g. what you should put in app.module.ts) and a link to further documentation relevant to the file (e.g. the Dependency Injection page in the Angular guide).
A few files that users are less likely to edit at the beginning of a project (environment.ts, polyfills.ts) have comments already. I think the "initial touch points" like components and modules would be good candidates for comments as well. This might also encourage more folks to document their code, which would be a benefit.
Versions.
Please run
ng --version. angular-cli: 1.0.0-beta.20-4
If a new users follows the Quick Start guide in Angular's website they should become familiar with the basic files and structure of an Angular 2 application. For everything else there's ng doc <keyword>.
I'm with @flwyd on this one. There is no harm putting a few concise comments in to code, to help clarify key concepts, proper usage, and 1 example of what you could do if you started hacking on that method, or class. I comment my code, very sparse. There's no reason why we shouldn't be helping the n00b5 with this.
@baruchvlz, i think you meant to type, "follow the Quick Start guide that can be found at cli.angular.io". i don't think the main angular site has any cli examples to this date.
@Taco-Gestapo Well, I said angular.io cause OP's request is to add information to briefly describes what the file is used for and what can be done with it. He also mentions a link to the documentation which can be found using the doc command. For example: ng doc component opens https://angular.io/docs/ts/latest/api/#!?apiFilter=component
Let me clarify, I'm not saying it's a bad idea just stating other methods that can come to the same result.
We might be able to use more comments, yes. We will see if we can get to it later on :) Cheers
@hansl , maybe we could add the "What it does" from the Angular API docs to the main cli generated templates, such as components, services, and directives etc.
If that sounds alright to you, I can grab this one.
Thanks!
We've added more comments overall, and some links to documentation.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.