Search code examples
angularjsdocumentationdocumentation-generationjsdocngdoc

How to describe angular controller methods in documentation?


I can't describe controllers methods. How i can do this?

/**
* @ngdoc controller
* @name works.controller:worksCtrl
* @requires $http
* @requires $element
* @function
*
* @description
* Description for works controller. All methods will be writen later
*/
var worksCtrl = function ($http, $element) {

    var ctrl = this;

    //how it do there? this not work
    /** 
        * @name initializeGrid
        * @function
        * @description
        * Description for initializeGrid
    */
    ctrl.initializeGrid = function (a) {
       //...
    }

    ctrl.getTemplate = function (workIndex) {
      //...

    }
    //...
};

I am using ngdoc for auto generate documentation. But i can't understand what i do wrong.


Solution

  • /**
    * @ngdoc function
    * @name initializeGrid
    * @methodOf works.controller:worksCtrl
    * @description This method initialize auto grid system for works
    * @private
    */
    
    ctrl.initializeGrid = function () {
         ...
    }
    

    That is what i need.)