Rendering API
NgDoc supports rendering API information in your guides.
API rendering
To render API information you can use the
class that provides methods to generate API tables and details for the provided declaration path.
Api
The
method generates API tables for the provided declaration path.
{{ NgDocApi.api("path/from/root/to/declaration.ts#MyClassName") }}
Details
The
method generates API details with information about generic types, decorators, selectors, etc. based on the provided declaration type.
{{ NgDocApi.details("path/from/root/to/declaration.ts#MyClassName") }}
JSDoc rendering
To render JSDoc comments you can use the
class that provides methods to display JSDoc comments for the provided declaration path.
Description
The
method returns the JSDoc description for the provided declaration path.
{{ JSDoc.description("path/from/root/to/declaration.ts#MyClassName") }}
Tag
The
method returns the JSDoc tag description for the provided declaration path.
{{ JSDoc.tag("path/from/root/to/declaration.ts#MyClassName", "deprecated") }}
Tags
The
returns an array of rendered JSDoc tags for the provided declaration path. You can use this list to render all tags manually using nunjucks.
{% set tags = JSDoc.tags("path/from/root/to/declaration.ts#MyClassName", "see") %}
{% for tag in tags %}
{{ tag }}
{% endfor %}
HasTag
The
method returns true if the provided declaration path has the specified JSDoc tag.
{{ JSDoc.hasTag("path/from/root/to/declaration.ts#MyClassName", "deprecated") }}