angular的 typescript 代码库中的/**@docs-private */的含义是什么?

bejyjqdl  于 2022-12-19  发布在  TypeScript
关注(0)|答案(1)|浏览(109)

我正在阅读GitHub上的一些@angular/cdk代码,我想知道这个“@docs-private”注解的含义。
https://github.com/angular/components/blob/main/src/cdk/table/row.ts

* Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
 * for changes and notifying the table.
 */
@Directive()
export abstract class BaseRowDef implements OnChanges {
  /** The columns to be displayed on this row. */
  columns: Iterable<string>;

  /** Differ used to check if any changes were made to the columns. */
  protected _columnsDiffer: IterableDiffer<any>;

  constructor(
    /** @docs-private */ public template: TemplateRef<any>,
    protected _differs: IterableDiffers,
  ) {}

  ngOnChanges(changes: SimpleChanges): void {
    // Create a new columns differ if one does not yet exist. Initialize it based on initial value
    // of the columns property or an empty array if none is provided.
    if (!this._columnsDiffer) {
      const columns = (changes['columns'] && changes['columns'].currentValue) || [];
      this._columnsDiffer = this._differs.find(columns).create();
      this._columnsDiffer.diff(columns);
    }
  }```
dgsult0t

dgsult0t1#

它是Angular 文件的内部工具

  • https://github.com/angular/components/blob/main/CODING_STANDARDS.md#access-modifiers

此外,@docs-private JsDoc注解可用于隐藏公共API文档中的任何符号。
在GitHub中,你可以在代码库中做一个search--对于这样的事情非常方便

相关问题