Questions tagged [ngdoc]

Inline language for documenting angularjs applications

ngdoc is based on JSDoc and includes the following AngularJS specific tags:

@ngdoc           specifies the type of thing being documented. See below for more detail.
@scope           specifies that the documented directive will create a new scope
@priority        specifies the documented directive's priority
@animations      specifies the animations that the documented directive supports
@methodOf type   links a method to the object/service where it is defined
@propertyOf type links a property to the object/service where it is defined
@eventOf type    links a method to the object/service where it is defined
@eventType emit | broadcast specifies whether the event is emitted or broadcast

References

35 questions
13
votes
3 answers

How to annotate ngdoc for an Angular component?

I'm writing an AngularJS component and I was wondering what's the correct way to add ngdoc annotation both to the component itself and to the controller function. Do you have any examples?
gabric
  • 1,865
  • 2
  • 21
  • 32
8
votes
3 answers

How to document a factory that returns a class in angular with ngdoc?

Given an angular app with a factory that returns a class, as such: angular.module('fooApp').factory('User', function(){ function User(name){ this.name = name; } User.prototype.greet = function(){ return "Howdy, " +…
Yuval Karmi
  • 26,277
  • 39
  • 124
  • 175
7
votes
3 answers

ngdoc documentation for controller

I am to new to code documentation and trying to document my angular application with grunt-ngdocs. I cloned a working example from: https://github.com/m7r/grunt-ngdocs-example The given example lacks a documented controller so I added my own…
6
votes
3 answers

How can ngdoc be used to document a function declaration in an angular service?

I would like to add ngdoc documentation to a function declaration within an angular service. How can I do this for myFunction in the example below? I reckon I need something like @closure, @functionOf or @functionIn. Please note that (in contrast…
paulhhowells
  • 321
  • 3
  • 11
4
votes
1 answer

How can I indicate dependencies to external modules?

I'm starting to document my app using ngdoc (a variant of jsdoc). The first thing I'm doing is documenting my main module. This module depends on a bunch of angular modules, e.g. ngAnimate. I'd like to indicate these requirements: /** * @ngdoc…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
3
votes
0 answers

ngdoc custom type definition

A directive i have in my project is getting large with a lot of different options One of my parameters is called tableFields this object has lots of options you can add to it: To do this ive attempted to create a typedef (type definition) however…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
3
votes
0 answers

Define a controller that is specific to a directive in ngdocs

I am using ngdocs to document my AngularJS application. I have a controller in the API that is specific to the directive itself. I have attempted to document this as @module.directive:dirName.controller:ControllerName, but this doesn't seem to tag…
cirrusio
  • 580
  • 5
  • 28
3
votes
2 answers

Modifying the grunt-ngDocs template

How can I modify the look&feel template of the website generated by grunt-ngDocs ? The final goal is to integrate the generated documentation inside a website. Per example, we want to display the following tabs for each topic Demo (focused on the…
PEC
  • 632
  • 1
  • 11
  • 28
2
votes
0 answers

ESLint not working with ngDoc names - AngularJS

I am creating documentation for an AngularJS app using ngDoc(dgeni), the documentation is generated correctly but the ESLint shows JSDoc syntax error valid-jsdoc, of course I don't want to disable this rule because is really helpful when there is…
Luis Gonzalez
  • 531
  • 5
  • 16
2
votes
1 answer

How to document the objects created by a factory function using ngdoc in angular?

How do I use ngdoc to document an 'angular factory' that returns a 'factory function'? Specifically, how do I document the objects my 'factory function' creates? In the contrived example below I've documented how to use the factory to create a page…
voncrease
  • 21
  • 2
2
votes
1 answer

angularjs create documentation via grunt and ngdocs

Hello I'm trying to create a documentation for my ionicframework/angularjs application via grunt and ngdoc. I've installed everything like preferred in http://gruntjs.com/getting-started Well if I now run grunt I get: Running "jshint:gruntfile"…
Kingalione
  • 4,237
  • 6
  • 49
  • 84
2
votes
1 answer

grunt-ngdoc is not rendering examples for my ngdoc documentation

I'm trying to get a basic example to work using ngDoc for my Angular project. Here is an example: /** * @ngdoc directive * @name ui.components.uiRepeat * @description * * Place this attribute directive on any element that has an `ng-repeat` on…
Reactgular
  • 52,335
  • 19
  • 158
  • 208
2
votes
0 answers

How to document properties of properties of services?

Given this code: var zomg = angular.module('zomg', []); /** * @ngdoc object * @name zomg.Foo * @description * # Foo */ zomg.factory('Foo', [function () { return { /** * @ngdoc object * @name zomg.Foo.bar * @propertyOf…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
2
votes
0 answers

ngDocs - how can i define dependencies before the doc is generated?

I am using ngDocs to document directives in angular. The documentation and the example is working well but the Demo is not generated because the main module which the directives are based on is declared after the page is generated. so i get the…
user2436448
  • 445
  • 4
  • 7
  • 18
2
votes
1 answer

grunt-ngdocs: styles file not included to demo code

I am using grunt-ngdocs to document my Angular project. But the demo Plunker code (generated automatically) doesn't include the CSS file. My configuration in Gruntfile.js includes: ... scripts: [ …
Joy
  • 9,430
  • 11
  • 44
  • 95
1
2 3