Documentation Site: Compodoc
- From the root folder install dev-dependencies:
cd ds-sdc-dev
npm install
- Compodoc looks for a tsconfig.doc.json file with the location of your component and any files you want to exclude.
{
"include": [
"component-library/component-lib/src/lib/**/*.ts",
"component-library/component-lib/src/lib/**/**/*.ts",
"component-library/component-lib/src/lib/shared/**/**/*.ts",
],
"exclude": [
"src/**/*.spec.ts"
]
}
- Launch interactive documentation server with the command below and open the link generated in your terminal:
npm run compodoc
Compodoc starts at the folder level of the tsconfig file provided with -p option.
.
├── src
│ ├── app
│ │ ├── app.component.ts
│ │ └── app.module.ts
│ ├── main.ts
│ └── ...
├── tsconfig.app.json
├── tsconfig.doc.json
└── tsconfig.json
Use code comments to clearly explain @Inputs, any mandatory and optional configuration, lifecycle methods or custom methods.
Comments must be ABOVE the relevant @Input or method as such:
/**
* FormGroup aggregates the values of each child FormControl into one object, with each control name as the key. It calculates its status by reducing the status values of its children. For example, if one of the controls in a group is invalid, the entire group becomes invalid.
*/