角度サービス内の関数宣言にngdocのドキュメントを追加したいと思います。下の例でmyFunctionに対してこれをどのように行うことができますか?ngdocを使って、角度サービスの関数宣言を文書化する方法はありますか?
私は@closure、@functionOf、@functionInのようなものが必要です。
myMethodとは対照的に、myFunctionはメソッドではありません。
/**
* @ngdoc service
* @name myApp.service:myService
* @description
* My application.
*/
angular
.module('myApp')
.factory('myService', function() {
'use strict';
var x = 0;
/**
* @ngdoc function
* @name ?
* @description
* How can this be identified as being within the closure of
* myService, and not be described as a constructor?
*/
function myFunction (z) {
x++;
x += z;
}
return {
/**
* @ngdoc method
* @name myMethod
* @methodOf myApp.service:myService
* @description
* A method of myService.
*/
myMethod : function (x) {
myFunction(x);
}
};
})
私はここngdocsのドキュメントを見つけました:https://github.com/idanush/ngdocs/wiki/API-Docs-Syntax – paulhhowells
、ここで:https://github.com/angular /angular.js/wiki/Writing-AngularJS-Documentation – paulhhowells