Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you document AngularJS directives?

Are there any ad hoc standards or tools for documenting AngularJS directives? We're explicitly building pieces of reusable functionality, so we should be able to get their interfaces across to developers. I've seen a couple of things:

  • Swagger. I love the direction Swagger 2.0 is going, but it's not clear how it would be used to document directives.
  • Ngdoc (https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation) This has the advantage that it's the same tool the AngularJS team uses.

Is there some better method people have found?

like image 212
fool4jesus Avatar asked Oct 27 '14 19:10

fool4jesus


1 Answers

Have a look at angular's source, the comments there are what is used to generate the documentation on angular site

a similar approach is used in this grunt plugin: https://github.com/Vertafore/grunt-docular

which is what we use where I work

like image 140
DrogoNevets Avatar answered Nov 10 '22 13:11

DrogoNevets