AngularJS评论风格指南

AngularJS评论风格指南,angularjs,Angularjs,当查看Angular的源代码时,似乎有一种特定的方式来设置注释的样式。快速浏览并不能揭示应该遵循哪些规则。指导方针是什么 例如,函数的注释如下所示: /** * when using forEach the params are value, key, but it is often useful to have key, value. * @param {function(string, *)} iteratorFn * @returns {function(*, string)} */ fu

当查看Angular的源代码时,似乎有一种特定的方式来设置注释的样式。快速浏览并不能揭示应该遵循哪些规则。指导方针是什么

例如,函数的注释如下所示:

/**
* when using forEach the params are value, key, but it is often useful to have key, value.
* @param {function(string, *)} iteratorFn
* @returns {function(*, string)}
*/
function reverseParams(iteratorFn) {
  return function(value, key) { iteratorFn(key, value); };
}

它以斜杠(/)开头,后跟两个星号(*),每行上都有一个星号。这个定义在哪里?然后有几个"符号"。Javascript注释以
/*
/
开头,如所示,因此这里还涉及一些其他样式。我正在寻找关于这个的描述……

好的,我将自己回答这个问题。有人给了我一个答案的评论,现在被删除了。谢谢你,不管你是谁。我正在剪切和粘贴此文档:

文档注释是用HTML编写的,必须在类、字段、构造函数或方法声明之前。它由两部分组成——一部分是描述,另一部分是块标记。在本例中,块标记为@param、@return和@see

/**
 * Returns an Image object that can then be painted on the screen. 
 * The url argument must specify an absolute {@link URL}. The name
 * argument is a specifier that is relative to the url argument. 
 * <p>
 * This method always returns immediately, whether or not the 
 * image exists. When this applet attempts to draw the image on
 * the screen, the data will be loaded. The graphics primitives 
 * that draw the image will incrementally paint on the screen. 
 *
 * @param  url  an absolute URL giving the base location of the image
 * @param  name the location of the image, relative to the url argument
 * @return      the image at the specified URL
 * @see         Image
 */
 public Image getImage(URL url, String name) {
        try {
            return getImage(new URL(url, name));
        } catch (MalformedURLException e) {
            return null;
        }
 }

看到这篇文章后,我试着键入“/**”,我在vs代码编辑器中得到了这个结果

按回车键,我就这样了


然而,我不知道它是否来自vs代码扩展。我认为这是一种标准的评论方式。

可能重复的答案中没有任何关于评论风格的建议。也许我有点瞎?
getImage

public Image getImage(URL url,
             String name)
Returns an Image object that can then be painted on the screen. The url argument must specify an absolute URL. The name argument is a specifier that is relative to the url argument.

This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.

Parameters:
url - an absolute URL giving the base location of the image.
name - the location of the image, relative to the url argument.
Returns:
the image at the specified URL.
See Also:
Image