【发布时间】:2017-05-25 23:54:21
【问题描述】:
我们应该使用什么标签来用 JSDoc 记录 Angular JS 组件?我在考虑使用@module,对吗?
例如:
/**
* @module helloWorld
*
* @description AngularJS component to display a message with a name.
*
*/
angular.component('helloWorld', {
bindings: {
name: '@'
},
controller : function helloWorldCtrl () {
this.logName = logName;
/**
* @function logName
*
* @param {string} msg - message to display with the name.
*
* @memberof helloWorld
*
* @description Log in the console the message with the name.
*
*/
function logName(msg) {
console.log(msg + this.name);
}
},
template : '<div><span ng-click="$ctrl.logName('Hi ')">{{$ctrl.name}}!</span></div>'
});
对于指令、服务和控制器,我也会有同样的问题。另外我使用@memberof的方式对吗?
【问题讨论】:
-
您是否已经看过ngdocs 或angular-jsdoc?两者都使用
ngdoc指令。还有一个有趣的链接:Writing AngularJS Documentation -
@Brakebein :thanx,不幸的是,对于这个项目使用 JSDoc 是我老板必须的,他不希望我使用 ngdoc
标签: javascript angularjs jsdoc