我正在阅读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);
}
}```
1条答案
按热度按时间dgsult0t1#
它是Angular 文件的内部工具
此外,@docs-private JsDoc注解可用于隐藏公共API文档中的任何符号。
在GitHub中,你可以在代码库中做一个
search
--对于这样的事情非常方便